Class SetVector

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--SetVector

public class SetVector
extends java.util.Vector

Vector with set operations union and intersect; only use with small vectors, as in storing unification values. Does not currently enforce "no duplicates", except that union and intersect do not introduce dups if each set has no dups.

See Also:
Serialized Form

Field Summary
private static java.util.Hashtable h
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData, serialVersionUID
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SetVector()
          Constructs an empty vector.
SetVector(int initialCapacity)
          Constructs an empty vector with the specified initial capacity.
SetVector(int initialCapacity, int capacityIncrement)
          Constructs an empty SetVector with the specified initial capacity and capacity increment.
 
Method Summary
 void addElementUniquely(java.lang.Object o)
           
static void main(java.lang.String[] args)
           
 SetVector union(java.util.Vector v)
           
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, ensureCapacityHelper, 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, registerNatives, wait, wait, wait
 

Field Detail

h

private static java.util.Hashtable h
Constructor Detail

SetVector

public SetVector(int initialCapacity,
                 int capacityIncrement)
Constructs an empty SetVector with the specified initial capacity and capacity increment.
Parameters:
initialCapacity - the initial capacity of the vector.
capacityIncrement - the amount by which the capacity is increased when the vector overflows.

SetVector

public SetVector(int initialCapacity)
Constructs an empty vector with the specified initial capacity.
Parameters:
initialCapacity - the initial capacity of the vector.

SetVector

public SetVector()
Constructs an empty vector.
Method Detail

addElementUniquely

public void addElementUniquely(java.lang.Object o)

union

public SetVector union(java.util.Vector v)

main

public static void main(java.lang.String[] args)