edu.cuny.tac.aa.util
Class SortedTreeList<M extends java.lang.Comparable>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.apache.commons.collections.list.TreeList
              extended by edu.cuny.tac.aa.util.SortedTreeList<M>
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.List

public class SortedTreeList<M extends java.lang.Comparable>
extends org.apache.commons.collections.list.TreeList

A tree-based sorted list.

Version:
$Revision: 1.10 $
Author:
Jinzhong Niu

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SortedTreeList(java.lang.String name)
           
 
Method Summary
 boolean add(M o)
          adds o into the list maintaining its sorted nature.
 int indexOfIfAdded(int b, int e, M o)
          determines its index if an object is added into the list
 int indexOfIfAdded(M o)
           
 
Methods inherited from class org.apache.commons.collections.list.TreeList
add, clear, contains, get, indexOf, iterator, listIterator, listIterator, remove, set, size, toArray
 
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, lastIndexOf, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray
 

Constructor Detail

SortedTreeList

public SortedTreeList(java.lang.String name)
Method Detail

add

public boolean add(M o)
adds o into the list maintaining its sorted nature.

Parameters:
o -
Returns:
always returns true

indexOfIfAdded

public int indexOfIfAdded(M o)

indexOfIfAdded

public int indexOfIfAdded(int b,
                          int e,
                          M o)
determines its index if an object is added into the list

Parameters:
b -
e -
o -
Returns:
the index