|
jBNC Toolbox | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjbnc.dataset.AttributeSpecs
Describes a single attribute/feature in a data set.
Dataset,
NamesReader,
DatasetReader| Nested Class Summary | |
static class |
AttributeSpecs.AttributeException
Exception specific to the AttributeSpecs class. |
| Constructor Summary | |
AttributeSpecs()
By default created attribute with type IGNORE. |
|
AttributeSpecs(java.lang.String name,
AttributeType type)
Can create attribute with type CONTINUOUS or IGNORE. |
|
AttributeSpecs(java.lang.String name,
int n)
Creates a disctete attribute with n states (DISCRETE_N). |
|
AttributeSpecs(java.lang.String name,
java.lang.String[] states)
Creates a DISCRETE attribute. |
|
| Method Summary | |
java.lang.String |
getName()
Get attribute name. |
java.lang.String |
getState(int index)
Returns state name for a state with the given state index. |
int |
getState(java.lang.String name)
Returns state index for a state with the given state name. |
java.lang.String[] |
getStates()
Return states of a discrete attribute. |
AttributeType |
getType()
Get attribute type. |
void |
setName(java.lang.String name)
Set attribute name. |
void |
setStates(java.lang.String[] states)
Set states of a discrete attribute. |
void |
setType(AttributeType type)
Set attribute type. |
void |
setType(AttributeType type,
int n)
Set attribute type to DISCRETE_N and specify number of states n. |
java.lang.String |
toString()
Description of the attribute type or list of attribute states (in type is DISCRETE). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AttributeSpecs()
public AttributeSpecs(java.lang.String name,
AttributeType type)
throws AttributeSpecs.AttributeException
name - Name of the attribute.type - Type of the attribute (CONTINUOUS or
IGNORE).
AttributeSpecs.AttributeException - Attribute type is neither CONTINUOUS nor
IGNORE.
public AttributeSpecs(java.lang.String name,
java.lang.String[] states)
name - Name of the attribute.states - States of the discrete attribute.
public AttributeSpecs(java.lang.String name,
int n)
throws AttributeSpecs.AttributeException
name - Name of the attribute.n - Number of discrete values represented by
the attribute (from 0 to n-1).
AttributeSpecs.AttributeException - type is not equal to DISCRETE_N.| Method Detail |
public void setName(java.lang.String name)
name - The new Name valuepublic void setType(AttributeType type)
type - The new Type value
public void setType(AttributeType type,
int n)
throws AttributeSpecs.AttributeException
n.
type - Attriute byte type. Has to be DESCRETE_N.n - Number of discrete values represented by the
attribute (from 0 to n-1).
AttributeSpecs.AttributeException - type is not equal to DISCRETE_N.
AttributeSpecs.AttributeException - n is less then one.
public void setStates(java.lang.String[] states)
throws AttributeSpecs.AttributeException
states - The new States value
AttributeSpecs.AttributeException - Description of Exceptionpublic java.lang.String getName()
public AttributeType getType()
public java.lang.String getState(int index)
throws AttributeSpecs.AttributeException
index - Description of Parameter
AttributeSpecs.AttributeException - Description of Exception
public int getState(java.lang.String name)
throws AttributeSpecs.AttributeException
name - Description of Parameter
AttributeSpecs.AttributeException - Description of Exceptionpublic java.lang.String[] getStates()
public java.lang.String toString()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||