|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.util.HolderObject
An abstract base class for mutable holder objects. This base class declares
a comparator method that may be used to determine the relative order of
two holder objects, based on the cardinality of their respective values.
It also introduces the notion of a subtype, which is an arbitrary
integer that may be used to store additional information about the value
stored in this holder. One possible use for the subtype field is to store
a format type (such as one of the data format constants defined in the
kiwi.text.FormatConstants
interface); such information can be
useful to tree and table cell renderers, for example.
kiwi.text.FormatConstants
Field Summary | |
protected int |
subtype
The subtype for the value stored by this holder. |
Constructor Summary | |
protected |
HolderObject()
Construct a new HolderObject . |
protected |
HolderObject(int subtype)
Construct a new HolderObject with the specified subtype. |
Method Summary | |
abstract int |
compareTo(HolderObject other)
Compare the value in this HolderObject to the value in
another HolderObject . |
int |
getSubtype()
Get the subtype for the value stored by this holder. |
void |
setSubtype(int subtype)
Set the subtype for the value stored by this holder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int subtype
Constructor Detail |
protected HolderObject()
HolderObject
.
protected HolderObject(int subtype)
HolderObject
with the specified subtype.
subtype
- The subtype.Method Detail |
public abstract int compareTo(HolderObject other)
HolderObject
to the value in
another HolderObject
. It is assumed that the two values
are of the same type (hence that the holders are also of the same type).
other
- The HolderObject
to compare against.
-1
if this object is "less than" the other object;
1
if this object is "greater than" the other object, and
0
if the objects are "equal."public void setSubtype(int subtype)
subtype
- The new subtype.public int getSubtype()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |