bill.util
Class SortedVector

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--bill.util.SortedVector
All Implemented Interfaces:
Cloneable, Collection, List, Serializable

public class SortedVector
extends Vector
implements Cloneable

Small utility class which extends the standard Java Vector class adding the ability add data to a Vector in a sorted manner.

See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SortedVector()
           
 
Method Summary
 boolean add(Comparable object)
          Makes sure that data added to the vector is placed in the correct sorted order.
 void addElement(Comparable object)
          Makes sure that data added to the vector is placed in the correct sorted order.
 Object clone()
          Makes a shallow copy of the current SortedVector instance.
 SortedVector cloneDeep()
          Makes a deep copy of the current SortedVector instance.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

SortedVector

public SortedVector()
Method Detail

clone

public Object clone()
Makes a shallow copy of the current SortedVector instance.
Overrides:
clone in class Vector
Returns:
A copy of the current instance.

cloneDeep

public SortedVector cloneDeep()
Makes a deep copy of the current SortedVector instance. Note that this will only work if the contents of the vector are all serializable!
Returns:
A deep copy of the current instance.

add

public boolean add(Comparable object)
Makes sure that data added to the vector is placed in the correct sorted order. This is done by comparing the new item being inserted to the current contents.
Parameters:
object - The new data item being inserted into the SortedVector.

addElement

public void addElement(Comparable object)
Makes sure that data added to the vector is placed in the correct sorted order. This is done by comparing the new item being inserted to the current contents.
Parameters:
object - The new data item being inserted into the SortedVector.
See Also:
add(Comparable)