|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for modeling mathematical sets. A set knows all its elements, the number of elements, and can be used to iterate over them.
This is not intended to be used for implementing collection data structures:
size() must return -1. For
debugging purposes, a (finite) skeleton subset may be defined using
sizeSkel() and iteratorSkel().
iterator() and isElement() are closely related,
there is an inner class Default containing a default implementation
of isElement() in terms of iterator().
| Inner Class Summary | |
static class |
Set.Default
Container class for default implementations of methods. |
| Method Summary | |
boolean |
equals(java.lang.Object e1,
java.lang.Object e2)
Checks if two elements of this set are equal. |
boolean |
isElement(java.lang.Object e)
Checks if an element is contained in this set. |
java.util.Iterator |
iterator()
Returns an Iterator of the elements of this set. |
java.util.Iterator |
iteratorSkel()
Returns an Iterator of the elements of the skeleton subset this
set. |
long |
size()
Returns the size of this set. |
long |
sizeSkel()
Returns the size of the skeleton subset of this set. |
| Method Detail |
public boolean equals(java.lang.Object e1,
java.lang.Object e2)
equals is reflexive,
transitive and symmetric. Furthermore, equals(e1,e2) should
coincide with e1.equals(e2).e1 - a value of type Objecte2 - a value of type Objecttrue if e1 and e2 belong to this
set and are equal, false otherwiseDomain.checkProperties(Set set)public boolean isElement(java.lang.Object e)
isElement() is true for all
objects generated by iterator() and false for all other
objects.e - a value of type Objecttrue if and only if this set contains this element.iterator(),
Domain.checkProperties(Set set)public java.util.Iterator iterator()
Iterator of the elements of this set.
isElement(Object e) yields true for all elements.Iterator of all elements of this set.isElement(Object e),
Domain.checkProperties(Set set)public long size()
iterator().hasNext() can be called.Domain.checkProperties(Set set)public java.util.Iterator iteratorSkel()
Iterator of the elements of the skeleton subset this
set. It maybe null if there is no skeleton subset.
isElement(Object e) yields true for all elements.Iterator of all elements of this set.isElement(Object e),
Domain.checkProperties(Set set)public long sizeSkel()
iterator().hasNext() can be called.Domain.checkProperties(Set set)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||