wt.clients.util
Class StringVector

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended bywt.clients.util.StringVector
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable

public class StringVector
extends Vector

Class StringVector is a utility class for creating Vectors that contain only String objects. The Vector of strings can be created in a given sorted order where the default sorting order is ascending (a to z).

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
static int ASCENDING
          Defined int constant to indicate a sorting order of ascending
static int DESCENDING
          Defined int constant to indicate a sorting order of descending
private static String versionID
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
StringVector()
          Default constructor for StringVector.
StringVector(Enumeration elements)
          Constructor for StringVector.
StringVector(String[] elements)
          Constructor for StringVector.
StringVector(String[] elements, int sort_type)
          Constructor for StringVector.
 
Method Summary
private  void sort()
           
 void sort(com.objectspace.jgl.BinaryPredicate direction)
          Sorts this StringVector using the given BinaryPredicate to specify the sorting direction.
 void sort(int direction)
          Sorts this StringVector in the given direction.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, 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
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

ASCENDING

public static final int ASCENDING
Defined int constant to indicate a sorting order of ascending

See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
Defined int constant to indicate a sorting order of descending

See Also:
Constant Field Values
Constructor Detail

StringVector

public StringVector()
Default constructor for StringVector. The Vector is created as unsorted.


StringVector

public StringVector(String[] elements)
Constructor for StringVector. The given array of Strings is placed in the Vector, and the Vector is sorted in ascending order.

Parameters:
elements - an Array of String elements which are added to the Vector and sorted

StringVector

public StringVector(String[] elements,
                    int sort_type)
Constructor for StringVector. The given array of Strings is placed in the Vector, and the Vector is sorted in the order specified by the given sorting type.

Parameters:
elements - an Array of String elements which are added to the Vector and sorted
sort_type - an int specifying the sorting direction: ASCENDING, DESCENDING

StringVector

public StringVector(Enumeration elements)
Constructor for StringVector. The elements of the given Enumeration are used to initialize the Vector. The Vector is sorted in the default ascending order.

Parameters:
elements - an Enumeration of elements to be added to the Vector and sorted
Method Detail

sort

private void sort()

sort

public void sort(int direction)
Sorts this StringVector in the given direction.

Parameters:
direction - the int direction in which to sort the Vector. If the given value is not one of ASCENDING or DESCENDING, then ASCENDING is used.

sort

public void sort(com.objectspace.jgl.BinaryPredicate direction)
Sorts this StringVector using the given BinaryPredicate to specify the sorting direction.

Parameters:
direction - the BinaryPredicate specifying the sorting direction to use.
See Also:
BinaryPredicate