All Packages Class Hierarchy This Package Previous Next Index
Class com.roguewave.tools.v2-0.IdentitySet
java.lang.Object
|
+----com.roguewave.tools.v2-0.Set
|
+----com.roguewave.tools.v2-0.IdentitySet
- public class IdentitySet
- extends Set
- implements Cloneable, Serializable
-
IdentitySet()
- Creates an empty set with default capacity.
-
IdentitySet(int)
- Creates an empty set with a given initial capacity.
-
clone()
- Returns a clone of this IdentitySet.
-
contains(Object)
- Returns true if the IdentitySet contains an element identical to the
given item, false otherwise.
-
difference(IdentitySet, IdentitySet)
- Returns a new IdentitySet containing the difference (A - B)
of the two IdentitySets specified.
-
differenceWith(IdentitySet)
- Modifies self to contain the difference of self with the given set
(self = self - set)
-
find(Object)
-
Returns the element identical to the given item, or null if no such
element is found.
-
insert(Object)
-
Adds a new item to the IdentitySet.
-
intersection(IdentitySet, IdentitySet)
- Returns a new set containing the intersection of the two IdentitySet
s
specified.
-
intersectionWith(IdentitySet)
- Modifies self to contain the intersection of self
and the given set.
-
remove(Object)
- Removes from the IdentitySet the element identical to the given item.
-
removeAll(Object)
- Removes from the IdentitySet all elements identical to the given item.
-
symmetricDifference(IdentitySet, IdentitySet)
- Returns a new set containing the symmetric difference between the two
IdentitySets specified.
The symmetric difference between IdentitySet A and IdentitySet B is the difference (A - B)
unioned with the difference (B - A).
-
symmetricDifferenceWith(IdentitySet)
- Modifies self to contain the symmetric difference between self
and the given set.
The symmetric difference between IdentitySet A and IdentitySet B is the difference (A - B)
unioned with the difference (B - A).
-
union(IdentitySet, IdentitySet)
- Returns a new set containing the union of the two IdentitySets specified.
-
unionWith(IdentitySet)
- Modifies self to contain the union of self and the given set.
IdentitySet
public IdentitySet()
- Creates an empty set with default capacity.
IdentitySet
public IdentitySet(int n)
- Creates an empty set with a given initial capacity.
- Parameters:
- n - The initial capacity of the underlying Hashtable
clone
public synchronized Object clone()
- Returns a clone of this IdentitySet. Note that the elements
themselves are not cloned.
- Overrides:
- clone in class Set
contains
public boolean contains(Object item)
- Returns true if the IdentitySet contains an element identical to the
given item, false otherwise.
- Overrides:
- contains in class Set
find
public Object find(Object item)
- Returns the element identical to the given item, or null if no such
element is found.
- Overrides:
- find in class Set
insert
public synchronized Object insert(Object item)
- Adds a new item to the IdentitySet.
The insertion fails if the IdentitySet already contains an element
identical to item.
- Returns:
- As with the parent class, the new element
if the insertion is
successful, the existing element if it is not. Note that
in both cases the method returns item!.
- Overrides:
- insert in class Set
remove
public synchronized Object remove(Object item)
- Removes from the IdentitySet the element identical to the given item.
The method does nothing if no such element is found.
- Returns:
- The removed element, or null
if no such element is found.
- Overrides:
- remove in class Set
removeAll
public int removeAll(Object item)
- Removes from the IdentitySet all elements identical to the given item.
Note that since collections does not admit duplicate entries, the
maximum number of elements removed will be 1.
- Returns:
- The number of elements removed
- Overrides:
- removeAll in class Set
intersection
public static IdentitySet intersection(IdentitySet s1,
IdentitySet s2)
- Returns a new set containing the intersection of the two IdentitySet
s
specified.
intersectionWith
public IdentitySet intersectionWith(IdentitySet set)
- Modifies self to contain the intersection of self
and the given set.
- Returns:
- self
difference
public static IdentitySet difference(IdentitySet s1,
IdentitySet s2)
- Returns a new IdentitySet containing the difference (A - B)
of the two IdentitySets specified.
differenceWith
public IdentitySet differenceWith(IdentitySet set)
- Modifies self to contain the difference of self with the given set
(self = self - set)
- Returns:
- self
symmetricDifference
public static IdentitySet symmetricDifference(IdentitySet s1,
IdentitySet s2)
- Returns a new set containing the symmetric difference between the two
IdentitySets specified.
The symmetric difference between IdentitySet A and IdentitySet B is the difference (A - B)
unioned with the difference (B - A).
symmetricDifferenceWith
public IdentitySet symmetricDifferenceWith(IdentitySet set)
- Modifies self to contain the symmetric difference between self
and the given set.
The symmetric difference between IdentitySet A and IdentitySet B is the difference (A - B)
unioned with the difference (B - A).
- Returns:
- self
union
public static IdentitySet union(IdentitySet s1,
IdentitySet s2)
- Returns a new set containing the union of the two IdentitySets specified.
unionWith
public IdentitySet unionWith(IdentitySet set)
- Modifies self to contain the union of self and the given set.
- Returns:
- self
All Packages Class Hierarchy This Package Previous Next Index