JIDE 3.5.15

com.jidesoft.range
Class Category<T>

java.lang.Object
  extended by com.jidesoft.range.Category<T>
All Implemented Interfaces:
Positionable, Serializable, Comparable<Positionable>
Direct Known Subclasses:
ChartCategory

public class Category<T>
extends Object
implements Positionable, Serializable

This class is really an adapter because it takes any object and allows it to be used as a Category.

Author:
Simon White (swhite@catalysoft.com)
See Also:
Serialized Form

Constructor Summary
Category(String name, T value)
           
Category(String name, T value, CategoryRange<T> range)
           
Category(T value)
           
Category(T value, CategoryRange<T> range)
           
 
Method Summary
 int compareTo(Positionable o)
           
 boolean equals(Object obj)
           
 String getName()
          Returns the name of the category which, when set, will be used as a label for the category.
 CategoryRange<T> getRange()
           
 T getValue()
          Returns the original value of the category
 int hashCode()
           
 double position()
          Returns the position of the category, which will be used to decide where to place a category along an axis.
 void setRange(CategoryRange<T> range)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Category

public Category(String name,
                T value)

Category

public Category(String name,
                T value,
                CategoryRange<T> range)

Category

public Category(T value)

Category

public Category(T value,
                CategoryRange<T> range)
Method Detail

getRange

public CategoryRange<T> getRange()

setRange

public void setRange(CategoryRange<T> range)

position

public double position()
Returns the position of the category, which will be used to decide where to place a category along an axis.

Specified by:
position in interface Positionable
Returns:
the position of the category

getValue

public T getValue()
Returns the original value of the category

Returns:
the value of the category

getName

public String getName()
Returns the name of the category which, when set, will be used as a label for the category. If it is not set explicitly, then the toString() of the category value will be used instead.

Returns:
the name of the category.

compareTo

public int compareTo(Positionable o)
Specified by:
compareTo in interface Comparable<Positionable>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15