|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
CategorySet contains a set of
categorical values that constitute a categorical
attribute, cost matrix, confusion matrix, etc.
Each category exists at an index from 0 to N-1,
where N is the cardinality of the set. To have
NULL be a valid value, it must be explicitly
assigned or use the default property of "valid".
To have NULL as a missig value, it must be
explicitly identified as "missing".
| Method Summary | |
int |
addCategory(java.lang.Object categoryValue,
CategoryProperty property)
Adds a categorical value to the set and returns an index that is to be used to refer to the value. |
AttributeDataType |
getDataType()
Returns the data type of the categorical values in the set. |
CategoryProperty |
getDefaultProperty()
Returns the default property of unspecified categorical values that are not contained in the set. |
java.lang.Integer |
getIndex(java.lang.Object categoryValue)
Returns the index of the categorical value. |
java.lang.String |
getName(int index)
Returns the name of the categorical value with the specified index. |
CategoryProperty |
getProperty(int index)
Returns the property of the categorical value with the specified index. |
int |
getSize()
Returns the number of categories in the set. |
java.lang.Object |
getValue(int index)
Returns the categorical value with the specified index. |
java.lang.Object[] |
getValues()
Returns all categorical values contained in the set. |
java.lang.Object[] |
getValues(CategoryProperty property)
Returns the list of all values with the given property. |
void |
insertCategory(java.lang.Object categoryValue,
CategoryProperty property,
int beforeIndex)
Inserts the given category value and property before the given index in the set. |
void |
removeCategory(int index)
Removes the categorical value refered to by the specified index. |
void |
setDefaultProperty(CategoryProperty property)
Sets the default property of unspecified categorical values that are not contained in the set. |
void |
setName(int index,
java.lang.String categoryName)
Sets the name of the category specified by the index. |
| Method Detail |
public int addCategory(java.lang.Object categoryValue,
CategoryProperty property)
throws JDMException
categoryValue - A categorical value to be added.property -
JDMExceptionpublic AttributeDataType getDataType()
public CategoryProperty getDefaultProperty()
valid.
public java.lang.Integer getIndex(java.lang.Object categoryValue)
throws JDMException
categoryValue - A categorical value whose index is to be returned.
JDMExceptionpublic java.lang.String getName(int index)
Names need not be unique within the set.
index - The index of the categorical value whose name is to be returned.
public CategoryProperty getProperty(int index)
index - The index of the categorical value whose property is to be returned.
public int getSize()
public java.lang.Object getValue(int index)
index - The index of the categorical value to be returned.
public java.lang.Object[] getValues()
public java.lang.Object[] getValues(CategoryProperty property)
throws JDMException
property -
JDMException
public void insertCategory(java.lang.Object categoryValue,
CategoryProperty property,
int beforeIndex)
throws JDMException
categoryValue - property - beforeIndex -
JDMException
public void removeCategory(int index)
throws JDMException
A subsequent call of getValue(index) or getProperty(index) will return the value delivered by getValue(index+1) or getProperty(index+1), respectively.
index - The index of the categorical value to be removed.
JDMExceptionpublic void setDefaultProperty(CategoryProperty property)
property - The default property of the unknown categorical values.
public void setName(int index,
java.lang.String categoryName)
index - categoryName -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||