|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.data.provider.FieldKey
public class FieldKey
FieldKey is a representation of an identifier for a specific data
element that may be retrieved from a DataProvider
. Specialized
implementations might also provide extra capabilities for navigation
between elements, or other value added services.
FieldKey implements Comparable, to allow for sorting based on the displayName of the FieldKey. Note that the Comparable equals test may not correspond to the FieldKey.equals(...) test, as the Comparable implementation is working with the displayName, while the equals(...) method works with the fieldId.
Field Summary | |
---|---|
static FieldKey[] |
EMPTY_ARRAY
A convenient static empty array to use for no-op method returns |
Constructor Summary | |
---|---|
FieldKey(java.lang.String fieldId)
Constructs a new FieldKey with the specified canonical ID. |
|
FieldKey(java.lang.String fieldId,
java.lang.String displayName)
Constructs a new FieldKey with the specified canonical ID and display name. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Standard compareTo implementation (for Comparable interface). |
boolean |
equals(java.lang.Object o)
Standard equals implementation. |
java.lang.String |
getDisplayName()
|
java.lang.String |
getFieldId()
|
int |
hashCode()
|
void |
setDisplayName(java.lang.String displayName)
|
void |
setFieldId(java.lang.String fieldId)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final FieldKey[] EMPTY_ARRAY
Constructor Detail |
---|
public FieldKey(java.lang.String fieldId)
fieldId
- The desired canonical ID Stringpublic FieldKey(java.lang.String fieldId, java.lang.String displayName)
fieldId
- The desired canonical ID String for this fielddisplayName
- The desired display name StringMethod Detail |
---|
public void setFieldId(java.lang.String fieldId)
fieldId
- the canonical internal identifier of this FieldKey
public java.lang.String getFieldId()
FieldKey
public void setDisplayName(java.lang.String displayName)
displayName
- The display name for this data element, suitable for
inclusion in a menu of available options.public java.lang.String getDisplayName()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the Object to check equality
Object.equals(Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public int compareTo(java.lang.Object o)
Comparable
interface).
This method compares FieldKeys for sorting by comparing the displayName
values.
compareTo
in interface java.lang.Comparable
o
- Object to compare
Comparable.compareTo(Object)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |