|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.tables.ESet
Untamed: A wrapper around an EMap, whose set-elements are the keys of the EMap.
XXX To be re-rationalized when we deprecate mutable collections. But introduced for now in order to remove 'Set' and its bretheren from Dean's transformer.
Field Summary | |
(package private) EMap |
myMap
XXX Should build an ESet directly from a KeyColumn rather than an EMap. |
(package private) static long |
serialVersionUID
|
Fields inherited from interface org.erights.e.elib.serial.Persistent |
HONORARY, HONORED_NAMES |
Constructor Summary | |
(package private) |
ESet(EMap map)
Only subclasses within the package |
Method Summary | |
ConstSet |
and(ESet mask)
Enabled: The intersection of the sets. |
ConstSet |
butNot(ESet mask)
Enabled: The subset of this set not in 'mask'. |
boolean |
contains(Object candidate)
Enabled: Is the candidate the same as any of the elements of the set? |
FlexSet |
diverge()
Enabled: 'type' default to Object.class |
FlexSet |
diverge(Class type)
Enabled: Returns a FlexSet whose initial state is a snapshot of the state of this set at the time of the diverge() request. |
Class |
elementType()
Enabled: All elements of this set must be of this type. |
Object |
getElements()
Enabled: Defaults to an array of elementType() |
Object |
getElements(Class elementType)
Enabled: Returns a divergent array-of-type of all the values in order. |
boolean |
intersects(ESet other)
Enabled: Do these sets have any elements in common? |
void |
iterate(AssocFunc func)
Enabled: Call 'func' with each index-value pair in the set, in order. |
ConstSet |
or(ESet behind)
Enabled: Defaults to not strict. |
ConstSet |
or(ESet behind,
boolean strict)
Enabled: Returns the union of the sets. |
void |
printOn(String left,
String sep,
String right,
TextWriter out)
Enabled: Onto out, print 'left' element0 'sep' ... |
ESet |
readOnly()
Enabled: Returns a read-only facet on this set. |
int |
size()
Enabled: How many entries are in the set? |
ConstSet |
snapshot()
Enabled: Returns a ConstSet whose state is a snapshot of the state of this set at the time of the snapshot() request. |
ConstSet |
sort()
Enabled: Returns a snapshot of this set, but reordered so the elements are in ascending order. |
ConstSet |
sort(CompFunc func)
Enabled: Returns a snapshot of this set, but reordered so the elements are in ascending order according to func. |
String |
toString()
Suppressed: |
ConstSet |
with(Object newElement)
Enabled: Returns a ConstSet just like this one, except containing newElement. |
ConstSet |
without(Object element)
Enabled: Returns a ConstSet just like this one, except that there is no ConstSet for 'key'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.erights.e.elib.oldeio.EPrintable |
__printOn |
Field Detail |
static final long serialVersionUID
final EMap myMap
Constructor Detail |
ESet(EMap map)
Method Detail |
public ConstSet snapshot()
public ESet readOnly()
public FlexSet diverge(Class type)
Further changes to the original and/or the new set are independent -- they diverge.
The new set is constrained to only hold object of type 'type'. XXX 'type' should be declared as a ValueGuard rather than Class.
public FlexSet diverge()
public boolean contains(Object candidate)
public boolean intersects(ESet other)
public int size()
public void iterate(AssocFunc func)
iterate
in interface Iteratable
public ConstSet or(ESet behind, boolean strict)
If sets intersect, then if strict, throw an exception.
In the order, the 'behind' keys come first in their original order, then the receiver's remaining keys in their original order.
public ConstSet or(ESet behind)
public ConstSet and(ESet mask)
The order in the intersection is taken from the smaller of the original two. If they're the same size, then the receiver's order is used.
public ConstSet butNot(ESet mask)
The order is the order of the receiver, as modified by removal of the elements in mask in mask's order.
public Object getElements()
public Object getElements(Class elementType)
XXX Should elementType be a ValueGuard rather than a Class?
public ConstSet with(Object newElement)
The order is the same as the original; if 'newElement' is new, it is added to the end of the order.
newElement
- nullOk;public ConstSet without(Object element)
This is currently horribly inefficient. Can be made efficient by using backward deltas.
element
- nullOk;public ConstSet sort()
public ConstSet sort(CompFunc func)
public Class elementType()
XXX This should return a ValueGuard rather than a Class
public void printOn(String left, String sep, String right, TextWriter out) throws IOException
IOException
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |