public abstract class CategoricalMeasure extends java.lang.Object implements Measure
Categorical data may be subdivided into nominal data and ordinal data.
Both integer and string variables can be made into categorical measure, but a categorical measure's levels will always be string values.
| Constructor and Description |
|---|
CategoricalMeasure(int[] values)
Constructor.
|
CategoricalMeasure(int[] values,
java.lang.String[] levels)
Constructor.
|
CategoricalMeasure(java.util.List<java.lang.String> levels)
Constructor.
|
CategoricalMeasure(java.lang.String... levels)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
factor(int value)
Returns the factor value (in range [0, size)) of level.
|
java.lang.String |
level(int value)
Returns the level string representation.
|
java.lang.String[] |
levels()
Returns the levels.
|
int |
size()
Returns the number of levels.
|
java.lang.String |
toString(int value)
Returns the string value of a level.
|
java.lang.String |
toString(java.lang.Object o)
Returns the string representation of a value of the measure.
|
DataType |
type()
Returns the data type that is suitable for this measure scale.
|
java.lang.Number |
valueOf(java.lang.String s)
Returns a measurement value object represented by the argument string s.
|
int[] |
values()
Returns the valid value set.
|
public CategoricalMeasure(java.lang.String... levels)
levels - the levels of discrete values.public CategoricalMeasure(java.util.List<java.lang.String> levels)
levels - the levels of discrete values.public CategoricalMeasure(int[] values)
values - the valid values.public CategoricalMeasure(int[] values,
java.lang.String[] levels)
values - the valid values.levels - the levels of discrete values.public int size()
public int[] values()
public java.lang.String[] levels()
public java.lang.String level(int value)
public int factor(int value)
public DataType type()
public java.lang.String toString(int value)
public java.lang.String toString(java.lang.Object o)
Measurepublic java.lang.Number valueOf(java.lang.String s)
Measurepublic boolean equals(java.lang.Object o)
equals in class java.lang.Object