Class Attribute
- java.lang.Object
-
- Attribute
-
- Direct Known Subclasses:
NominalAttribute,NumericAttribute
abstract class Attribute extends java.lang.ObjectStores information for an attribute. An attribute has a name.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringnamethis attribute's name
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Gets the name of this attribute.voidsetName(java.lang.String name)Sets the name of this attribute to the specified name.(package private) abstract intsize()Gets the size of this attribute's domain.java.lang.StringtoString()Returns a string representation of this attribute with the@attributetag followed by the name.(package private) abstract booleanvalidValue(java.lang.Object value)Returns whether the specified value is valid for the attribute.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of this attribute.- Returns:
- a string storing the name
-
size
abstract int size()
Gets the size of this attribute's domain.- Returns:
- an int storing the size of the domain
-
setName
public void setName(java.lang.String name)
Sets the name of this attribute to the specified name.- Parameters:
name- the name of this attribute
-
toString
public java.lang.String toString()
Returns a string representation of this attribute with the@attributetag followed by the name.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this attribute
-
validValue
abstract boolean validValue(java.lang.Object value)
Returns whether the specified value is valid for the attribute.- Parameters:
value- the value for testing- Returns:
- true if the value is valid; false otherwise
-
-