com.rapidminer.example.table
Class AbstractAttribute

java.lang.Object
  extended by com.rapidminer.example.table.AbstractAttribute
All Implemented Interfaces:
Attribute, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DateAttribute, NominalAttribute, NumericalAttribute, ViewAttribute

public abstract class AbstractAttribute
extends java.lang.Object
implements Attribute

This is a possible abstract superclass for all attribute implementations. Most methods of Attribute are already implemented here.

Author:
Ingo Mierswa
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.rapidminer.example.Attribute
MISSING_NOMINAL_VALUE, UNDEFINED_ATTRIBUTE_INDEX, VIEW_ATTRIBUTE_INDEX
 
Method Summary
 void addOwner(Attributes attributes)
          Sets the Attributes instance to which this attribute belongs.
 void addTransformation(AttributeTransformation transformation)
           
 void clearTransformations()
          Clear all transformations.
abstract  java.lang.Object clone()
          Clones this attribute.
 boolean equals(java.lang.Object o)
          Returns true if the given attribute has the same name and the same table index.
 java.util.Iterator<Statistics> getAllStatistics()
          Returns the attribute statistics.
 int getBlockType()
          Returns the block type of this attribute.
 java.lang.String getConstruction()
          Returns the construction description.
 double getDefault()
          Returns the default value for this attribute.
 AttributeTransformation getLastTransformation()
           
 java.lang.String getName()
          Returns the name of the attribute.
 double getStatistics(java.lang.String name)
          Deprecated. Please use the method ExampleSet.getStatistics(Attribute, String) instead.
 double getStatistics(java.lang.String name, java.lang.String parameter)
          Deprecated. Please use the method ExampleSet.getStatistics(Attribute, String) instead.
 int getTableIndex()
          Returns the index in the example table.
 double getValue(DataRow row)
          Returns the value for the column this attribute corresponds to in the given data row.
 int getValueType()
          Returns the value type of this attribute.
 int hashCode()
          Returns the hash code.
 java.lang.Object readResolve()
           
 void registerStatistics(Statistics statistics)
          Registers the attribute statistics.
 void removeOwner(Attributes attributes)
           
 void setBlockType(int b)
          Sets the block type of this attribute.
 void setConstruction(java.lang.String description)
          Returns the construction description.
 void setDefault(double value)
          Sets the default value for this attribute.
 void setName(java.lang.String v)
          Sets the name of the attribute.
 void setTableIndex(int i)
          Sets the index in the example table.
 void setValue(DataRow row, double value)
          Sets the value for the column this attribute corresponds to in the given data row.
 java.lang.String toString()
          Returns a human readable string that describes this attribute.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.example.Attribute
getAsString, getMapping, isNominal, isNumerical, setMapping
 

Method Detail

readResolve

public java.lang.Object readResolve()

addOwner

public void addOwner(Attributes attributes)
Description copied from interface: Attribute
Sets the Attributes instance to which this attribute belongs. This instance will be notified when the attribute renames itself. This method must not be called except by the Attributes to which this AttributeRole is added.

Specified by:
addOwner in interface Attribute

removeOwner

public void removeOwner(Attributes attributes)
Specified by:
removeOwner in interface Attribute

clone

public abstract java.lang.Object clone()
Clones this attribute.

Specified by:
clone in interface Attribute
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Returns true if the given attribute has the same name and the same table index.

Specified by:
equals in interface Attribute
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Description copied from interface: Attribute
Returns the hash code. Please note that equal attributes must return the same hash code.

Specified by:
hashCode in interface Attribute
Overrides:
hashCode in class java.lang.Object

addTransformation

public void addTransformation(AttributeTransformation transformation)
Specified by:
addTransformation in interface Attribute

clearTransformations

public void clearTransformations()
Description copied from interface: Attribute
Clear all transformations.

Specified by:
clearTransformations in interface Attribute

getLastTransformation

public AttributeTransformation getLastTransformation()
Specified by:
getLastTransformation in interface Attribute

getValue

public double getValue(DataRow row)
Description copied from interface: Attribute
Returns the value for the column this attribute corresponds to in the given data row.

Specified by:
getValue in interface Attribute

setValue

public void setValue(DataRow row,
                     double value)
Description copied from interface: Attribute
Sets the value for the column this attribute corresponds to in the given data row.

Specified by:
setValue in interface Attribute

getName

public java.lang.String getName()
Returns the name of the attribute.

Specified by:
getName in interface Attribute

setName

public void setName(java.lang.String v)
Sets the name of the attribute.

Specified by:
setName in interface Attribute

getTableIndex

public int getTableIndex()
Returns the index in the example table.

Specified by:
getTableIndex in interface Attribute

setTableIndex

public void setTableIndex(int i)
Sets the index in the example table.

Specified by:
setTableIndex in interface Attribute

getBlockType

public int getBlockType()
Returns the block type of this attribute.

Specified by:
getBlockType in interface Attribute
See Also:
Ontology.ATTRIBUTE_BLOCK_TYPE

setBlockType

public void setBlockType(int b)
Sets the block type of this attribute.

Specified by:
setBlockType in interface Attribute
See Also:
Ontology.ATTRIBUTE_BLOCK_TYPE

getValueType

public int getValueType()
Returns the value type of this attribute.

Specified by:
getValueType in interface Attribute
See Also:
Ontology.ATTRIBUTE_VALUE_TYPE

getAllStatistics

public java.util.Iterator<Statistics> getAllStatistics()
Returns the attribute statistics.

Specified by:
getAllStatistics in interface Attribute

registerStatistics

public void registerStatistics(Statistics statistics)
Description copied from interface: Attribute
Registers the attribute statistics.

Specified by:
registerStatistics in interface Attribute

getStatistics

@Deprecated
public double getStatistics(java.lang.String name)
Deprecated. Please use the method ExampleSet.getStatistics(Attribute, String) instead.

Returns the attribute statistics.

Specified by:
getStatistics in interface Attribute

getStatistics

@Deprecated
public double getStatistics(java.lang.String name,
                                       java.lang.String parameter)
Deprecated. Please use the method ExampleSet.getStatistics(Attribute, String) instead.

Returns the attribute statistics.

Specified by:
getStatistics in interface Attribute

getConstruction

public java.lang.String getConstruction()
Returns the construction description.

Specified by:
getConstruction in interface Attribute

setConstruction

public void setConstruction(java.lang.String description)
Returns the construction description.

Specified by:
setConstruction in interface Attribute

setDefault

public void setDefault(double value)
Description copied from interface: Attribute
Sets the default value for this attribute.

Specified by:
setDefault in interface Attribute

getDefault

public double getDefault()
Description copied from interface: Attribute
Returns the default value for this attribute.

Specified by:
getDefault in interface Attribute

toString

public java.lang.String toString()
Returns a human readable string that describes this attribute.

Specified by:
toString in interface Attribute
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 by Rapid-I