Package com.jidesoft.range
Class Category<T>
- java.lang.Object
-
- com.jidesoft.range.Category<T>
-
- All Implemented Interfaces:
Positionable,java.io.Serializable,java.lang.Comparable<Positionable>
public class Category<T> extends java.lang.Object implements Positionable, java.io.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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Positionable o)booleanequals(java.lang.Object obj)java.lang.StringgetName()Returns the name of the category which, when set, will be used as a label for the category.CategoryRange<T>getRange()TgetValue()Returns the original value of the categoryinthashCode()doubleposition()Returns the position of the category, which will be used to decide where to place a category along an axis.voidsetRange(CategoryRange<T> range)java.lang.StringtoString()
-
-
-
Constructor Detail
-
Category
public Category(java.lang.String name, T value)
-
Category
public Category(java.lang.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:
positionin interfacePositionable- 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 java.lang.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:
compareToin interfacejava.lang.Comparable<T>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-