Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.converter
Class WekaAbstractAttribute<W extends WekaAbstractAttribute<W>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.converter.WekaAbstractAttribute<W>
All Implemented Interfaces:
WekaAttribute<W>, Comparable<W>
Direct Known Subclasses:
WekaNominalAttribute, WekaNumericAttribute, WekaStringAttribute

public abstract class WekaAbstractAttribute<W extends WekaAbstractAttribute<W>>
extends Object
implements WekaAttribute<W>

WekaAbstractAttribute handles the type of the attribute.

Author:
Arthur Zimek

Field Summary
private static int NOMINAL_INDEX
          The index of the type NOMINAL in TYPES.
private static int NUMERIC_INDEX
          The index of the type NUMERIC in TYPES.
private static int STRING_INDEX
          The index of the type STRING in TYPES.
private  int TYPE
          Holds the type of this attribute.
private static String[] TYPES
          Collects the possible types of attributes.
 
Fields inherited from interface de.lmu.ifi.dbs.elki.converter.WekaAttribute
NOMINAL, NUMERIC, STRING
 
Constructor Summary
protected WekaAbstractAttribute(String type)
          Sets this attribute to the specified type.
 
Method Summary
 boolean equals(Object o)
          This equals o, if both are of the same type and this.compareTo((W) o) returns 0.
 String getType()
          Returns the type of the attribute.
 int hashCode()
          Returns the hashCode of the attribute value.
 boolean isNominal()
          Returns whether the attribute is weka nominal.
 boolean isNumeric()
          Returns whether the attribute is weka numeric.
 boolean isString()
          Returns whether the attribute is weka string.
 String toString()
          Returns the value of the attribute.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.converter.WekaAttribute
getValue
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

TYPES

private static final String[] TYPES
Collects the possible types of attributes.


NOMINAL_INDEX

private static final int NOMINAL_INDEX
The index of the type NOMINAL in TYPES.


NUMERIC_INDEX

private static final int NUMERIC_INDEX
The index of the type NUMERIC in TYPES.


STRING_INDEX

private static final int STRING_INDEX
The index of the type STRING in TYPES.


TYPE

private final int TYPE
Holds the type of this attribute.

Constructor Detail

WekaAbstractAttribute

protected WekaAbstractAttribute(String type)
                         throws IllegalArgumentException
Sets this attribute to the specified type.

Parameters:
type - the type of this attribute - one of NOMINAL, NUMERIC, or STRING. Another value of the parameter type will result in an IllegalArgumentException.
Throws:
IllegalArgumentException - if the value of type is none of NOMINAL, NUMERIC, or STRING.
Method Detail

getType

public String getType()
Description copied from interface: WekaAttribute
Returns the type of the attribute.

Specified by:
getType in interface WekaAttribute<W extends WekaAbstractAttribute<W>>
Returns:
the type of the attribute, i.e. nominal, numeric, or string
See Also:
WekaAttribute.getType()

isNominal

public boolean isNominal()
Description copied from interface: WekaAttribute
Returns whether the attribute is weka nominal.

Specified by:
isNominal in interface WekaAttribute<W extends WekaAbstractAttribute<W>>
Returns:
true if the attribute is nominal, false otherwise
See Also:
WekaAttribute.isNominal()

isNumeric

public boolean isNumeric()
Description copied from interface: WekaAttribute
Returns whether the attribute is weka numeric.

Specified by:
isNumeric in interface WekaAttribute<W extends WekaAbstractAttribute<W>>
Returns:
true if the attribute is numeric, false otherwise
See Also:
WekaAttribute.isNumeric()

isString

public boolean isString()
Description copied from interface: WekaAttribute
Returns whether the attribute is weka string.

Specified by:
isString in interface WekaAttribute<W extends WekaAbstractAttribute<W>>
Returns:
true if the attribute is string, false otherwise
See Also:
WekaAttribute.isString()

toString

public String toString()
Returns the value of the attribute.

Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object o)
This equals o, if both are of the same type and this.compareTo((W) o) returns 0.

Specified by:
equals in interface WekaAttribute<W extends WekaAbstractAttribute<W>>
Overrides:
equals in class Object
Parameters:
o - another object to test for equality
Returns:
true if o is of the same type as this and this.compareTo((W)o)==0.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Returns the hashCode of the attribute value.

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

Release 0.1 (2008-07-10_1838)