|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
wt.eff.EffSet
This class is a modifiable implementation of the java.util.Set interface for storing compatible Eff objects. Two Eff objects, eff1 and eff2 are compatible if and only if:
Note: this collection does not assert the mutual compatibility of its members; this is the responsibility of the application.
The member Eff objects are not stored directly, but via instances of the EffSet.Element wrapper, the only type of element accepted by this set.
Note: this class makes no distinction between Eff objects based on their relative persistence status (i.e. persistent versus non- persistent); this is the responsibility of the application if it is relevant.
This collection does not permit the null element.
Nested Class Summary | |
static class |
EffSet.Element
|
Field Summary | |
private static HashMap |
effFactories
|
private HashSet |
hashSet
|
Constructor Summary | |
EffSet()
Constructs a new, empty EffSet. |
|
EffSet(EffGroup group)
Constructs a new EffSet containing new (non-persistent) Eff objects representing the argument EffGroup object. |
|
EffSet(EffSet s1,
EffSet s2)
Constructs a new EffSet containing the merge of the argument EffSet objects. |
Method Summary | |
boolean |
add(Object obj)
Adds the EffSet.Element object argument to this set if and only if it is not already present. |
void |
clear()
Removes all of the elements from this set. |
Object |
clone()
Returns a shallow copy of this EffSet: the elements themselves are not cloned. |
boolean |
contains(Object obj)
Returns true if this set contains the specified element. |
private EffRange |
duplicate(EffRange range)
Creates a deep copy of the argument EffRange object. |
Iterator |
iterator()
Returns an iterator over the elements in this set. |
private Eff |
newEff(Class type,
VersionReference target,
ObjectReference context,
EffRange range)
Creates a new Eff object of the specified type, referencing the specified target and context, and having the specified range. |
boolean |
remove(Object obj)
Removes the argument object from this set if it is present. |
int |
size()
Returns the number of elements in this set (its cardinality). |
String |
toString()
Returns a String representation of this set, listing each element per its own toString method. |
Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, isEmpty, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
addAll, containsAll, isEmpty, retainAll, toArray, toArray |
Field Detail |
private static HashMap effFactories
private HashSet hashSet
Constructor Detail |
public EffSet()
public EffSet(EffGroup group)
NullPointerException
- if the argument is nullpublic EffSet(EffSet s1, EffSet s2)
NullPointerException
- if either argument is null
wt.util.WTRuntimeException if the merged set cannot be computed because its elements are not compatible; note:/b> a failure to throw a wt.util.WTRuntimeException does not imply that all elements are mutually compatibleMethod Detail |
public Object clone()
public Iterator iterator()
iterator
in interface Set
public int size()
size
in interface Set
public boolean add(Object obj)
add
in interface Set
NullPointerException
- if the argument is null
ClassCastException if the argument is an object of a type other than EffSet.Elementpublic void clear()
clear
in interface Set
public boolean contains(Object obj)
contains
in interface Set
public boolean remove(Object obj)
remove
in interface Set
public String toString()
a
- wt.util.WTRuntimeException wrapping any wt.util.WTPropertyVetoException, which is unexpectedprivate Eff newEff(Class type, VersionReference target, ObjectReference context, EffRange range) throws WTPropertyVetoException
a
- wt.util.WTRuntimeException wrapping any reflection exceptions, which are unexpected
WTPropertyVetoException
private EffRange duplicate(EffRange range)
a
- wt.util.WTRuntimeException wrapping any I/O exceptions, which are unexpected
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |