org.tigris.gef.util
Class VectorSet

java.lang.Object
  extended byorg.tigris.gef.util.VectorSet
All Implemented Interfaces:
java.io.Serializable

public class VectorSet
extends java.lang.Object
implements java.io.Serializable

An Ordered, non-duplicated collecton of objects (not exactly a mathemetical set because it is ordered). Implemented with a Vector.

See Also:
Serialized Form

Field Summary
static int TC_LIMIT
           
 
Constructor Summary
VectorSet()
           
VectorSet(int n)
           
VectorSet(java.lang.Object o1)
           
 
Method Summary
 void addAllElements(java.util.Collection v)
           
 void addAllElements(java.util.Enumeration enum)
           
 void addAllElements(java.util.Iterator iter)
           
 void addAllElements(VectorSet s)
           
 void addAllElementsSuchThat(java.util.Enumeration enum, Predicate p)
           
 void addAllElementsSuchThat(java.util.Iterator iter, Predicate p)
           
 void addAllElementsSuchThat(VectorSet s, Predicate p)
           
 void addElement(java.lang.Object o)
           
 java.util.Vector asVector()
           
 boolean contains(java.lang.Object o)
           
 boolean containsSuchThat(Predicate p)
           
 java.lang.Object elementAt(int index)
           
 java.util.Enumeration elements()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object findSuchThat(Predicate p)
          return the first element that causes p.predicate() to return true.
 java.lang.Object firstElement()
           
 VectorSet reachable(ChildGenerator cg)
          Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator.
 VectorSet reachable(ChildGenerator cg, int max, Predicate p)
          Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator.
 void remove(java.lang.Object o)
           
 void removeAllElements()
           
 void removeElement(java.lang.Object o)
           
 int size()
           
 java.lang.String toString()
           
 VectorSet transitiveClosure(ChildGenerator cg)
          Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator.
 VectorSet transitiveClosure(ChildGenerator cg, int max, Predicate p)
          Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TC_LIMIT

public static final int TC_LIMIT
See Also:
Constant Field Values
Constructor Detail

VectorSet

public VectorSet()

VectorSet

public VectorSet(int n)

VectorSet

public VectorSet(java.lang.Object o1)
Method Detail

addElement

public void addElement(java.lang.Object o)

addAllElements

public void addAllElements(java.util.Collection v)

addAllElements

public void addAllElements(java.util.Enumeration enum)

addAllElements

public void addAllElements(java.util.Iterator iter)

addAllElementsSuchThat

public void addAllElementsSuchThat(java.util.Enumeration enum,
                                   Predicate p)

addAllElementsSuchThat

public void addAllElementsSuchThat(java.util.Iterator iter,
                                   Predicate p)

addAllElements

public void addAllElements(VectorSet s)

addAllElementsSuchThat

public void addAllElementsSuchThat(VectorSet s,
                                   Predicate p)

remove

public void remove(java.lang.Object o)

removeElement

public void removeElement(java.lang.Object o)

removeAllElements

public void removeAllElements()

contains

public boolean contains(java.lang.Object o)

containsSuchThat

public boolean containsSuchThat(Predicate p)

findSuchThat

public java.lang.Object findSuchThat(Predicate p)
return the first element that causes p.predicate() to return true.


elements

public java.util.Enumeration elements()

elementAt

public java.lang.Object elementAt(int index)

asVector

public java.util.Vector asVector()

equals

public boolean equals(java.lang.Object o)

firstElement

public java.lang.Object firstElement()

size

public int size()

toString

public java.lang.String toString()

transitiveClosure

public VectorSet transitiveClosure(ChildGenerator cg)
Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator. The result includes the elements of the original Set. In order to avoid very deep searches which are often programming mistakes, only paths of length TC_LIMIT or less are considered.


reachable

public VectorSet reachable(ChildGenerator cg)
Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator. The result DOES NOT include the elements of the original Set. In order to avoid very deep searches which are often programming mistakes, only paths of length TC_LIMIT or less are considered.


reachable

public VectorSet reachable(ChildGenerator cg,
                           int max,
                           Predicate p)
Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator. The result DOES NOT include the elements of the original Set. In order to avoid very deep searches which are often programming mistakes, only paths of given max length or less are considered. Only paths consisting of elements which all cause p.predicate() to return true are considered.


transitiveClosure

public VectorSet transitiveClosure(ChildGenerator cg,
                                   int max,
                                   Predicate p)
Reply the Set of all objects that can be reached from the receiving Set by taking steps defined by the given ChildGenerator. The result includes the elements of the original Set. In order to avoid very deep searches which are often programming mistakes, only paths of given max length or less are considered. Only paths consisting of elements which all cause p.predicate() to return true are considered.