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

Constructor Index

 o SortedVector()

Method Index

 o add(Sortable)
Adds an object to this vector at its proper place according to what its compareTo method returns
 o elements()
Gets an enumeration used to iterate in order through the contents of the vector
 o lastElement()
Gets the last (largest) element in the vector

Constructors

 o SortedVector
 public SortedVector()

Methods

 o 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
 o lastElement
 public Object lastElement()
Gets the last (largest) element in the vector

Returns:
the last element in the vector
 o 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