Package org.jfree.data
Class KeyedObject
- java.lang.Object
-
- org.jfree.data.KeyedObject
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,PublicCloneable
public class KeyedObject extends java.lang.Object implements java.lang.Cloneable, PublicCloneable, java.io.Serializable
A (key, object) pair.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ComparablekeyThe key.private java.lang.ObjectobjectThe object.private static longserialVersionUIDFor serialization.
-
Constructor Summary
Constructors Constructor Description KeyedObject(java.lang.Comparable key, java.lang.Object object)Creates a new (key, object) pair.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a clone of this object.booleanequals(java.lang.Object obj)Tests if this object is equal to another.java.lang.ComparablegetKey()Returns the key.java.lang.ObjectgetObject()Returns the object.voidsetObject(java.lang.Object object)Sets the object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
key
private java.lang.Comparable key
The key.
-
object
private java.lang.Object object
The object.
-
-
Method Detail
-
getKey
public java.lang.Comparable getKey()
Returns the key.- Returns:
- The key.
-
getObject
public java.lang.Object getObject()
Returns the object.- Returns:
- The object (possibly
null).
-
setObject
public void setObject(java.lang.Object object)
Sets the object.- Parameters:
object- the object (nullpermitted).
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this object. It is assumed that the key is an immutable object, so it is not deep-cloned. The object is deep-cloned if it implementsPublicCloneable, otherwise a shallow clone is made.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if there is a problem cloning.
-
equals
public boolean equals(java.lang.Object obj)
Tests if this object is equal to another.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the other object.- Returns:
- A boolean.
-
-