|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SetElement
This class allows the user to create set elements in the form of ordered pairs (K,I). K is a unique key and I is some information portion that need not be unique. A dictionary, for example, may be viewed as a set of ordered pairs. The first element of each pair is a unique key made up of a series of symbols (or,word). The second part of each pair is the definition or collection of definitions. The definition part need not be unique. The class SetElement holds two private data members that are both Strings. It provides routines that allow the client to manipulate objects that represent the ordered pairs (K,I).
Constructor Summary | |
SetElement(java.lang.String k,
java.lang.String i)
Create a pair with two Strings. |
Method Summary | |
java.lang.Object |
clone()
The clone() method, in this case, is not strictly needed (String is an immutable type and K and I are private) but is provided for easy expansion. |
int |
compareTo(java.lang.Object o)
This method allows us to compare two (K,I) objects. |
java.lang.String |
getData()
Return the Information portion I of the (K,I) pair. |
java.lang.String |
getUniqueID()
Return the unique part K of the (K,I) pair. |
static void |
main(java.lang.String[] a)
|
void |
setData(java.lang.String d)
Set the Information portion I of the (K,I) pair. |
void |
setUniqueID(java.lang.String value)
Set the unique part K of the (K,I) pair. |
java.lang.String |
toString()
The method toString converts the pair (K,I) to a String. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SetElement(java.lang.String k, java.lang.String i)
Method Detail |
public java.lang.String getUniqueID()
public java.lang.String getData()
public void setUniqueID(java.lang.String value)
public void setData(java.lang.String d)
public java.lang.Object clone()
public int compareTo(java.lang.Object o) throws java.lang.IllegalArgumentException
public java.lang.String toString()
public static void main(java.lang.String[] a)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |