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_.
-
_v
-
-
Set()
- The empty constructor == empty set.
-
Set(Object)
- Construct Set with one initial object.
-
Set(Object, Object)
- Construct Set with two initial objects.
-
Set(Object, Object, Object)
- Construct Set with three initial objects.
-
Set(Object, Object, Object, Object)
- Construct Set with four initial objects.
-
Set(Object, Object, Object, Object, Object)
- Construct Set with five initial objects.
-
Set(Object, Object, Object, Object, Object, Object)
- Construct Set with six initial objects.
-
Set(Object[])
- Construct Set from array.
-
Set(Vector)
- Construct Set from Vector.
-
delete(Object)
- Deletes an element of the set if that element is
element of the set, otherwise nothing
happens.
-
delete(Object[])
- Deletes from the set all elements which are
in the array and also in the set.
-
flatCopy()
- Copies the set; the contents of both sets is the _same_.
-
getObjectArray()
- Returns the elements of the set as an array.
-
insert(Object)
- Inserts object 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.
-
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.
-
intersection(Set)
- Gives a set which is the intersection of all sets in the
set s.
-
intersection(Set, Set)
- Gives a set which contains all elements which are in
set s1 and also in set s2.
-
isElement(Object)
- This method checks wether an Object is element of the Set.
-
isSubset(Set)
- This method tests wether s is subset of this set.
-
minus(Set, Set)
- Gives a set which contains all elements of set s1
and which are not in set s2.
-
size()
- Return the number of objects in the set.
-
toString()
- No comment.
-
union(Set)
- Gives a set which is the union of all sets in the set s.
-
union(Set, Set)
- Gives a set containing all elements of set s1 and set s2.
_v
protected Vector _v
Set
public Set()
- The empty constructor == empty set.
Set
public Set(Object oa[])
- Construct Set from array. Note: Nice for
using with anonymous arrays, which come
new with java 1.1!
Set
public Set(Vector v)
- Construct Set from Vector.
Set
public Set(Object o0)
- Construct Set with one initial object.
Set
public Set(Object o0,
Object o1)
- Construct Set with two initial objects.
Set
public Set(Object o0,
Object o1,
Object o2)
- Construct Set with three initial objects.
Set
public Set(Object o0,
Object o1,
Object o2,
Object o3)
- Construct Set with four initial objects.
Set
public Set(Object o0,
Object o1,
Object o2,
Object o3,
Object o4)
- Construct Set with five initial objects.
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.
insert
public void insert(Object o)
- Inserts object 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.
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.
delete
public void delete(Object o)
- Deletes an element of the set if that element is
element of the set, otherwise nothing
happens.
delete
public void delete(Object oa[])
- Deletes from the set all elements which are
in the array and also in the set.
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).
union
public static Set union(Set s1,
Set s2)
- Gives a set containing all elements of set s1 and set s2.
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.
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.
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.
isElement
public boolean isElement(Object o)
- This method checks wether an Object is element of the Set.
isSubset
public boolean isSubset(Set s)
- This method tests wether s is subset of this set.
size
public int size()
- Return the number of objects in the set. This
is named like the 'well named' Vector class.
getObjectArray
public Object[] getObjectArray()
- Returns the elements of the set as an array.
Note, that the sequence may be arbitrary.
toString
public String toString()
- No comment.
- Overrides:
- toString in class Object
flatCopy
public Set flatCopy()
- Copies the set; the contents of both sets is the _same_.
All Packages Class Hierarchy This Package Previous Next Index