org.jfree.report.style
Class StyleKey

java.lang.Object
  extended byorg.jfree.report.style.StyleKey
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class StyleKey
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

A style key represents a (key, class) pair. Style keys are used to access style attributes defined in a BandStyleSheet or an ElementStyleSheet

Note that this class also defines a static Hashtable in which all defined keys are stored.

Author:
Thomas Morgner
See Also:
BandStyleSheet, ElementStyleSheet, Serialized Form

Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getName()
          Returns the name of the key.
static StyleKey getStyleKey(java.lang.String name)
          Returns the key with the specified name.
static StyleKey getStyleKey(java.lang.String name, java.lang.Class valueType)
          Returns the key with the specified name.
static StyleKey getStyleKey(java.lang.String name, java.lang.Class valueType, boolean trans)
          Returns the key with the specified name.
 java.lang.Class getValueType()
          Returns the class of the value for this key.
 int hashCode()
          Returns a hash code value for the object.
 boolean isTransient()
           
protected  java.lang.Object readResolve()
          Replaces the automaticly generated instance with one of the defined stylekey instances or creates a new stylekey.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Returns the name of the key.

Returns:
the name.

getValueType

public java.lang.Class getValueType()
Returns the class of the value for this key.

Returns:
the class.

getStyleKey

public static StyleKey getStyleKey(java.lang.String name,
                                   java.lang.Class valueType)
Returns the key with the specified name. The given type is not checked against a possibly alredy defined definition, it is assumed that the type is only given for a new key definition.

Parameters:
name - the name.
valueType - the class.
Returns:
the style key.

getStyleKey

public static StyleKey getStyleKey(java.lang.String name,
                                   java.lang.Class valueType,
                                   boolean trans)
Returns the key with the specified name. The given type is not checked against a possibly alredy defined definition, it is assumed that the type is only given for a new key definition.

Parameters:
name - the name.
valueType - the class.
Returns:
the style key.

getStyleKey

public static StyleKey getStyleKey(java.lang.String name)
Returns the key with the specified name.

Parameters:
name - the name.
Returns:
the style key.

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.

Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Returns:
a hash code value for this object.

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
Replaces the automaticly generated instance with one of the defined stylekey instances or creates a new stylekey.

Returns:
the resolved element
Throws:
java.io.ObjectStreamException - if the element could not be resolved.

isTransient

public boolean isTransient()

toString

public java.lang.String toString()
Returns a string representation of the object.

Returns:
a string representation of the object.