com.jrefinery.report.targets.style
Class StyleKey

java.lang.Object
  |
  +--com.jrefinery.report.targets.style.StyleKey
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public 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.
 java.lang.Class getValueType()
          Returns the class of the value for this key.
 int hashCode()
          Returns a hash code value for the object.
protected  java.lang.Object readResolve()
          Replaces the automaticly generated instance with one of the defined stylekey instances or creates a new stylekey.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, 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.

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.

Overrides:
equals in class java.lang.Object
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.

Overrides:
hashCode in class java.lang.Object
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.