|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--shared.AttrInfo
|
+--shared.NominalAttrInfo
The NominalAttrInfo class allows giving the different values that the attribute may obtain.
| Fields inherited from class shared.AttrInfo |
attrName,
attrType,
boundedReal,
internalDisjunction,
linearNominal,
nominal,
real,
treeStructured,
unknown,
UNKNOWN_VAL_STR,
userInternalDisjunction,
userLinearNominal,
userNominal,
userReal,
userTreeStructured |
| Constructor Summary | |
NominalAttrInfo(java.lang.String aName,
int sizeHint)
Constructor. |
|
NominalAttrInfo(java.lang.String aName,
java.util.LinkedList attrVals)
Constructor. |
|
| Method Summary | |
java.lang.String |
attrValue_to_string(AttrValue val)
Converts the given AttrValue to the corresponding String representation of the nominal attribute value. |
boolean |
can_cast_to_nominal()
Checks if this AttrInfo subclass can be cast to a NominalAttrInfo class. |
NominalAttrInfo |
cast_to_nominal()
Casts this AttrInfo subclass to a NominalAttrInfo class. |
void |
check_in_range(AttrValue val)
Checks if the specified value is within the range for this attribute. |
java.lang.Object |
clone()
Cloning function for this NominalAttrInfo class. |
void |
display_attr_values()
Displays the attribute values in names file format. |
void |
display_attr_values(java.io.Writer stream,
boolean protectChars)
Displays the attribute values in names file format. |
boolean |
equal_value(AttrValue val1,
AttrValue val2)
Returns TRUE if given AttrValues are equivalent. |
void |
fix_values(boolean shouldFix)
Fixes the values for this attribute so new values will be added automatically. |
int |
get_nominal_val(AttrValue av)
Returns the nominal value stored in the specified AttrValue. |
java.lang.String |
get_value(int i)
Returns the ith attribute value stored in this NominalAttrInfo's possible value set. |
boolean |
is_fixed()
Checks if this attribute's possible value set is fixed. |
boolean |
is_unknown(AttrValue nominalValue)
Returns TRUE if given AttrValue is unknown. |
int |
num_values()
Returns number of possible values that the attribute has. |
AttrValue |
read_attr_value(java.io.BufferedReader stream,
boolean isTest,
FileSchema f)
Reads in an attribute value from the specified BufferedReader. |
AttrValue |
read_attr_value(java.io.StreamTokenizer stream,
boolean isTest,
FileSchema f)
Reads in an attribute value from the specified StreamTokenizer. |
void |
set_nominal_string(AttrValue av,
java.lang.String str,
boolean suppress)
Sets the representation of the given AttrValue using a String as input. |
void |
set_nominal_val(AttrValue av,
int val)
Sets the integer representation of the given AttrValue. |
void |
set_unknown(AttrValue val)
Sets the given AttrValue specified to be unknown. |
| Methods inherited from class shared.AttrInfo |
attr_type_to_string,
can_cast_to_real,
cast_to_real,
display_attr_values,
equal_shallow,
get_ignore,
get_real_val,
is_linear,
name,
protect_chars,
set_ignore,
set_real_val,
type |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public NominalAttrInfo(java.lang.String aName,
java.util.LinkedList attrVals)
aName - The name for this attribute.attrVals - The possible values for this attribute.
public NominalAttrInfo(java.lang.String aName,
int sizeHint)
aName - The name of this attribute.sizeHint - Currently ignored.| Method Detail |
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
public void fix_values(boolean shouldFix)
shouldFix - TRUE if the values should be fixed, FALSE if the values should be
unfixed.public void display_attr_values()
public void check_in_range(AttrValue val)
val - The value to be checked.public java.lang.String attrValue_to_string(AttrValue val)
val - The value to convert to a string.public int get_nominal_val(AttrValue av)
av - The AttrValue containing the value required.public void set_unknown(AttrValue val)
val - The value to be set to unknown.public boolean is_unknown(AttrValue nominalValue)
nominalValue - The AttrValue being checked for unknown value.
public void set_nominal_string(AttrValue av,
java.lang.String str,
boolean suppress)
av - The AttrValue where the new value will be stored.str - The String representing the new value.suppress - If the suppress parameter is TRUE, any unrecognized values
will become unknowns if fixedValueSet is set FALSE.
public void set_nominal_val(AttrValue av,
int val)
av - The AttrValue storing the new value.val - The new value to be stored.public boolean is_fixed()
public int num_values()
public java.lang.String get_value(int i)
i - The index value of the value queried.public boolean can_cast_to_nominal()
public NominalAttrInfo cast_to_nominal()
public AttrValue read_attr_value(java.io.BufferedReader stream,
boolean isTest,
FileSchema f)
stream - The BufferedReader containing the file to be read.isTest - TRUE if this value is for a test Instance, FALSE otherwise.f - The FileSchema for the file being read from.
public AttrValue read_attr_value(java.io.StreamTokenizer stream,
boolean isTest,
FileSchema f)
stream - The StreamTokenizer containing the file to be read.isTest - TRUE if this value is for a test Instance, FALSE otherwise.f - The FileSchema for the file being read from.
public boolean equal_value(AttrValue val1,
AttrValue val2)
val1 - An AttrValue to be compared.val2 - An AttrValue to be compared.
public void display_attr_values(java.io.Writer stream,
boolean protectChars)
stream - Writer to which the display will be written.protectChars - True if "\" and "." are to be protected by "\"
characters, false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||