com.sun.data.provider.impl
Class ObjectRowKey

java.lang.Object
  extended bycom.sun.data.provider.RowKey
      extended bycom.sun.data.provider.impl.ObjectRowKey
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class ObjectRowKey
extends RowKey

ObjectRowKey uses an object as the identifier for a data row in a TableDataProvider.

Author:
Joe Nuxoll
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sun.data.provider.RowKey
EMPTY_ARRAY
 
Constructor Summary
ObjectRowKey(java.lang.Object object)
          Constructs an ObjectRowKey using the specified object
 
Method Summary
 int compareTo(java.lang.Object o)
          Standard implementation of compareTo(Object).
 boolean equals(java.lang.Object o)
          Standard equals implementation.
 java.lang.Object getObject()
          Returns the object of this ObjectRowKey
 
Methods inherited from class com.sun.data.provider.RowKey
getRowId, setRowId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectRowKey

public ObjectRowKey(java.lang.Object object)
Constructs an ObjectRowKey using the specified object

Parameters:
object - The desired object
Method Detail

getObject

public java.lang.Object getObject()
Returns the object of this ObjectRowKey

Returns:
This ObjectRowKey's object value

equals

public boolean equals(java.lang.Object o)
Standard equals implementation. This method compares the ObjectRowKey object values for equality (== || .equals()). If the passed Object is not an ObjectRowKey instance, the superclass (RowKey) gets a chance to evaluate the Object for equality.

Overrides:
equals in class RowKey
Parameters:
o - the Object to check equality
Returns:
true if equal, false if not
See Also:
Object.equals(Object)

compareTo

public int compareTo(java.lang.Object o)

Standard implementation of compareTo(Object). This checks for equality first (using equals(Object)), then compares the stored object in the ObjectRowKeys. If the contained object does not implement Comparable, the superclass version of compareTo(Object) is invoked.

Standard implementation of compareTo(Object). This checks for equality first (using equals(Object)), then compares the rowId strings. This should be overridden by RowKey implementations that have a notion of order. This allows for deletions and insertions to be done in reverse order to help ensure the longevity of valid RowKeys.

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class RowKey