All Packages Class Hierarchy This Package Previous Next Index
Class net.strandberg.util.SortedVector
java.lang.Object
|
+----net.strandberg.util.SortedVector
- public class SortedVector
- extends Object
Class SortedVector is a vector of Sortable elements that is always kept sorted
internally. When an object is added, it is inserted at its proper place in the
vector. Insertion is done by linear search.
- Version:
- $Revision: 0.0 $
- Author:
- Mats Strandberg
-
SortedVector()
-
-
add(Sortable)
- Adds an object to this vector at its proper place according to what its
compareTo method returns
-
elements()
- Gets an enumeration used to iterate in order through the contents of the vector
-
lastElement()
-
Gets the last (largest) element in the vector
SortedVector
public SortedVector()
add
public void add(Sortable s)
- Adds an object to this vector at its proper place according to what its
compareTo method returns
- Parameters:
- s - object to be inserted
lastElement
public Object lastElement()
- Gets the last (largest) element in the vector
- Returns:
- the last element in the vector
elements
public Enumeration elements()
- Gets an enumeration used to iterate in order through the contents of the vector
- Returns:
- an enumeration to be used to iterate through the vector
All Packages Class Hierarchy This Package Previous Next Index