public class Attribute extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
ARFF_ATTRIBUTE
The keyword used to denote the start of an arff attribute declaration
|
static String |
ARFF_ATTRIBUTE_DATE
The keyword used to denote a date attribute
|
static String |
ARFF_ATTRIBUTE_INTEGER
A keyword used to denote a numeric attribute
|
static String |
ARFF_ATTRIBUTE_NUMERIC
A keyword used to denote a numeric attribute
|
static String |
ARFF_ATTRIBUTE_REAL
A keyword used to denote a numeric attribute
|
static String |
ARFF_ATTRIBUTE_RELATIONAL
The keyword used to denote a relation-valued attribute
|
static String |
ARFF_ATTRIBUTE_STRING
The keyword used to denote a string attribute
|
static String |
ARFF_END_SUBRELATION
The keyword used to denote the end of the declaration of a subrelation
|
protected List<String> |
attributeValues
The attribute values.
|
protected boolean |
isDate
The is date.
|
protected boolean |
isNominal
The is nominal.
|
protected boolean |
isNumeric
The is numeric.
|
protected SimpleDateFormat |
m_DateFormat
Date format specification for date attributes
|
protected String |
name
The name.
|
Constructor and Description |
---|
Attribute()
Instantiates a new attribute.
|
Attribute(String string)
Instantiates a new attribute.
|
Attribute(String attributeName,
List<String> attributeValues)
Instantiates a new attribute.
|
Attribute(String attributeName,
String dateFormat)
Instantiates a new attribute.
|
Modifier and Type | Method and Description |
---|---|
Enumeration |
enumerateValues()
Returns an enumeration of all the attribute's values if the
attribute is nominal, null otherwise.
|
List<String> |
getAttributeValues()
Gets the attribute values.
|
int |
indexOfValue(String value)
Index of value.
|
boolean |
isNominal()
Checks if is nominal.
|
boolean |
isNumeric()
Checks if is numeric.
|
String |
name()
Name.
|
int |
numValues()
Num values.
|
String |
toString()
Returns a description of this attribute in ARFF format.
|
String |
value(int value)
Value.
|
public static final String ARFF_ATTRIBUTE
public static final String ARFF_ATTRIBUTE_INTEGER
public static final String ARFF_ATTRIBUTE_REAL
public static final String ARFF_ATTRIBUTE_NUMERIC
public static final String ARFF_ATTRIBUTE_STRING
public static final String ARFF_ATTRIBUTE_DATE
public static final String ARFF_ATTRIBUTE_RELATIONAL
public static final String ARFF_END_SUBRELATION
protected boolean isNominal
protected boolean isNumeric
protected boolean isDate
protected SimpleDateFormat m_DateFormat
protected String name
public Attribute(String string)
string
- the stringpublic Attribute(String attributeName, List<String> attributeValues)
attributeName
- the attribute nameattributeValues
- the attribute valuespublic Attribute(String attributeName, String dateFormat)
attributeName
- the attribute namedateFormat
- the format of the date usedpublic Attribute()
public List<String> getAttributeValues()
public boolean isNominal()
public String name()
public String value(int value)
value
- the valuepublic boolean isNumeric()
public int numValues()
public final int indexOfValue(String value)
value
- the valuepublic final String toString()
public final Enumeration enumerateValues()
Copyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.