Class Attribute
- java.lang.Object
-
- Attribute
-
- Direct Known Subclasses:
NominalAttribute
,NumericAttribute
abstract class Attribute extends java.lang.Object
Stores information for an attribute. An attribute has a name.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
this attribute's name
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Gets the name of this attribute.void
setName(java.lang.String name)
Sets the name of this attribute to the specified name.(package private) abstract int
size()
Gets the size of this attribute's domain.java.lang.String
toString()
Returns a string representation of this attribute with the@attribute
tag followed by the name.(package private) abstract boolean
validValue(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@attribute
tag followed by the name.- Overrides:
toString
in 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
-
-