|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for an element in a dynamic set. We can get and set a
key, which is a Comparable
object, and we can compare
dynamic-set elements to other dynamic-set elements and, depending
on the implmentation, to arbitrary Comparable
objects.
Nested Class Summary | |
static class |
DynamicSetElement.Helper
Inner class to define static helper methods. |
Method Summary | |
int |
compareTo(java.lang.Object e)
Compares this DynamicSetElement to another object. |
java.lang.Comparable |
getKey()
Returns the key of an element. |
void |
setKey(java.lang.Comparable key)
Sets the key of an element. |
Method Detail |
public void setKey(java.lang.Comparable key)
key
- Key to be set.public java.lang.Comparable getKey()
public int compareTo(java.lang.Object e)
DynamicSetElement
to another object.
The normal implementation is simply return
DynamicSetElement.Helper.compareTo(this, e);
compareTo
in interface java.lang.Comparable
e
- The other object.
DynamicSetElement
is less; 0 if the objects are
equal; a positive integer if this
DynamicSetElement
is greater.
java.lang.ClassCastException
- if the implementation calls
DynamicSetElement.Helper.compareTo(this, e)
and
e
does not implement Comparable
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |