All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.txlayer.util.Set

java.lang.Object
   |
   +----semper.txlayer.util.Set

public class Set
extends Object
implements Serializable
This class implements the notion of a set. Note, that the class has inconsistencies with _same_ and _equal_.


Variable Index

 o _v

Constructor Index

 o Set()
The empty constructor == empty set.
 o Set(Object)
Construct Set with one initial object.
 o Set(Object, Object)
Construct Set with two initial objects.
 o Set(Object, Object, Object)
Construct Set with three initial objects.
 o Set(Object, Object, Object, Object)
Construct Set with four initial objects.
 o Set(Object, Object, Object, Object, Object)
Construct Set with five initial objects.
 o Set(Object, Object, Object, Object, Object, Object)
Construct Set with six initial objects.
 o Set(Object[])
Construct Set from array.
 o Set(Vector)
Construct Set from Vector.

Method Index

 o delete(Object)
Deletes an element of the set if that element is element of the set, otherwise nothing happens.
 o delete(Object[])
Deletes from the set all elements which are in the array and also in the set.
 o flatCopy()
Copies the set; the contents of both sets is the _same_.
 o getObjectArray()
Returns the elements of the set as an array.
 o insert(Object)
Inserts object o.
 o insert(Object[])
Inserts the objects of the array oa one after another; this call is equivalent to calling 'insert(oa[i])' on each index of oa, beginning with 0.
 o insert(Vector)
Inserts the objects of the Vector v one after another; this call is equivalent to calling 'insert(v.elementAt(i))' on each index of v, beginning with 0.
 o intersection(Set)
Gives a set which is the intersection of all sets in the set s.
 o intersection(Set, Set)
Gives a set which contains all elements which are in set s1 and also in set s2.
 o isElement(Object)
This method checks wether an Object is element of the Set.
 o isSubset(Set)
This method tests wether s is subset of this set.
 o minus(Set, Set)
Gives a set which contains all elements of set s1 and which are not in set s2.
 o size()
Return the number of objects in the set.
 o toString()
No comment.
 o union(Set)
Gives a set which is the union of all sets in the set s.
 o union(Set, Set)
Gives a set containing all elements of set s1 and set s2.

Variables

 o _v
 protected Vector _v

Constructors

 o Set
 public Set()
The empty constructor == empty set.

 o Set
 public Set(Object oa[])
Construct Set from array. Note: Nice for using with anonymous arrays, which come new with java 1.1!

 o Set
 public Set(Vector v)
Construct Set from Vector.

 o Set
 public Set(Object o0)
Construct Set with one initial object.

 o Set
 public Set(Object o0,
            Object o1)
Construct Set with two initial objects.

 o Set
 public Set(Object o0,
            Object o1,
            Object o2)
Construct Set with three initial objects.

 o Set
 public Set(Object o0,
            Object o1,
            Object o2,
            Object o3)
Construct Set with four initial objects.

 o Set
 public Set(Object o0,
            Object o1,
            Object o2,
            Object o3,
            Object o4)
Construct Set with five initial objects.

 o Set
 public Set(Object o0,
            Object o1,
            Object o2,
            Object o3,
            Object o4,
            Object o5)
Construct Set with six initial objects. This is the maximum number of elements for this easy way of construction. For more elements, use anonyn. array, or this in combination with insert() afterwards.

Methods

 o insert
 public void insert(Object o)
Inserts object o.

 o insert
 public void insert(Object oa[])
Inserts the objects of the array oa one after another; this call is equivalent to calling 'insert(oa[i])' on each index of oa, beginning with 0.

 o insert
 public void insert(Vector v)
Inserts the objects of the Vector v one after another; this call is equivalent to calling 'insert(v.elementAt(i))' on each index of v, beginning with 0.

 o delete
 public void delete(Object o)
Deletes an element of the set if that element is element of the set, otherwise nothing happens.

 o delete
 public void delete(Object oa[])
Deletes from the set all elements which are in the array and also in the set.

 o union
 public static Set union(Set s)
Gives a set which is the union of all sets in the set s. If one of the elements in s is not a set, an exception is thrown (in a soon version).

 o union
 public static Set union(Set s1,
                         Set s2)
Gives a set containing all elements of set s1 and set s2.

 o intersection
 public static Set intersection(Set s)
Gives a set which is the intersection of all sets in the set s. If one of the elements in s is not a set, an exception is thrown. I know that this is not really typesafe.

 o intersection
 public static Set intersection(Set s1,
                                Set s2)
Gives a set which contains all elements which are in set s1 and also in set s2.

 o minus
 public static Set minus(Set s1,
                         Set s2)
Gives a set which contains all elements of set s1 and which are not in set s2.

 o isElement
 public boolean isElement(Object o)
This method checks wether an Object is element of the Set.

 o isSubset
 public boolean isSubset(Set s)
This method tests wether s is subset of this set.

 o size
 public int size()
Return the number of objects in the set. This is named like the 'well named' Vector class.

 o getObjectArray
 public Object[] getObjectArray()
Returns the elements of the set as an array. Note, that the sequence may be arbitrary.

 o toString
 public String toString()
No comment.

Overrides:
toString in class Object
 o flatCopy
 public Set flatCopy()
Copies the set; the contents of both sets is the _same_.


All Packages  Class Hierarchy  This Package  Previous  Next  Index