com.rapidminer.example
Interface Attribute

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
AbstractAttribute, BinominalAttribute, DateAttribute, NominalAttribute, NumericalAttribute, PolynominalAttribute, ViewAttribute

public interface Attribute
extends java.lang.Cloneable, java.io.Serializable

Attributes should hold all information about a single attribute.

Author:
Ingo Mierswa

Field Summary
static java.lang.String MISSING_NOMINAL_VALUE
          Indicates a missing value for nominal values.
static int UNDEFINED_ATTRIBUTE_INDEX
          Used to identify that this attribute is not part of any example table.
static int VIEW_ATTRIBUTE_INDEX
          Used to identify view attributes
 
Method Summary
 void addOwner(Attributes attributes)
          Sets the Attributes instance to which this attribute belongs.
 void addTransformation(AttributeTransformation transformation)
           
 void clearTransformations()
          Clear all transformations.
 java.lang.Object clone()
          Clones this attribute.
 boolean equals(java.lang.Object o)
          Returns true if the given object is an attribute with the same name and table index.
 java.util.Iterator<Statistics> getAllStatistics()
          Returns an iterator over all statistics objects available for this type of attribute.
 java.lang.String getAsString(double value, int digits, boolean quoteNominal)
          Returns a formatted string of the given value according to the attribute type.
 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()
           
 NominalMapping getMapping()
          Returns the nominal mapping between nominal values and internal double representations.
 java.lang.String getName()
          Returns the name of the attribute.
 double getStatistics(java.lang.String statisticsName)
          Deprecated. Please use the method ExampleSet.getStatistics(Attribute, String) instead.
 double getStatistics(java.lang.String statisticsName, java.lang.String parameter)
          Deprecated. Please use the method ExampleSet.getStatistics(Attribute, String, 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.
 boolean isNominal()
          Returns true if the attribute is nominal.
 boolean isNumerical()
          Returns true if the attribute is nominal.
 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)
          Sets the construction description.
 void setDefault(double value)
          Sets the default value for this attribute.
 void setMapping(NominalMapping nominalMapping)
          Returns the nominal mapping between nominal values and internal double representations.
 void setName(java.lang.String name)
          Sets the name of the attribute.
 void setTableIndex(int index)
          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.
 

Field Detail

UNDEFINED_ATTRIBUTE_INDEX

static final int UNDEFINED_ATTRIBUTE_INDEX
Used to identify that this attribute is not part of any example table.

See Also:
Constant Field Values

VIEW_ATTRIBUTE_INDEX

static final int VIEW_ATTRIBUTE_INDEX
Used to identify view attributes

See Also:
Constant Field Values

MISSING_NOMINAL_VALUE

static final java.lang.String MISSING_NOMINAL_VALUE
Indicates a missing value for nominal values. For the internal values and numerical values, Double.NaN is used which can be checked via Double.isNaN(double).

See Also:
Constant Field Values
Method Detail

equals

boolean equals(java.lang.Object o)
Returns true if the given object is an attribute with the same name and table index.

Overrides:
equals in class java.lang.Object

hashCode

int hashCode()
Returns the hash code. Please note that equal attributes must return the same hash code.

Overrides:
hashCode in class java.lang.Object

clone

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


getName

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


setName

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


getTableIndex

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


setTableIndex

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


addOwner

void addOwner(Attributes attributes)
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.


removeOwner

void removeOwner(Attributes attributes)

getValue

double getValue(DataRow row)
Returns the value for the column this attribute corresponds to in the given data row.


setValue

void setValue(DataRow row,
              double value)
Sets the value for the column this attribute corresponds to in the given data row.


addTransformation

void addTransformation(AttributeTransformation transformation)

getLastTransformation

AttributeTransformation getLastTransformation()

clearTransformations

void clearTransformations()
Clear all transformations.


getAllStatistics

java.util.Iterator<Statistics> getAllStatistics()
Returns an iterator over all statistics objects available for this type of attribute. Additional statistics can be registered via registerStatistics(Statistics).


registerStatistics

void registerStatistics(Statistics statistics)
Registers the attribute statistics.


getStatistics

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

Returns the attribute statistics.


getStatistics

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

Returns the attribute statistics with the given parameter.


getConstruction

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


setConstruction

void setConstruction(java.lang.String description)
Sets the construction description.


getMapping

NominalMapping getMapping()
Returns the nominal mapping between nominal values and internal double representations. Please note that invoking this method might result in an exception for non-nominal attributes.


setMapping

void setMapping(NominalMapping nominalMapping)
Returns the nominal mapping between nominal values and internal double representations. Please note that invoking this method might result in an exception for non-nominal attributes.


getBlockType

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

See Also:
Ontology.ATTRIBUTE_BLOCK_TYPE

setBlockType

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

See Also:
Ontology.ATTRIBUTE_BLOCK_TYPE

getValueType

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

See Also:
Ontology.ATTRIBUTE_VALUE_TYPE

toString

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

Overrides:
toString in class java.lang.Object

setDefault

void setDefault(double value)
Sets the default value for this attribute.


getDefault

double getDefault()
Returns the default value for this attribute.


isNominal

boolean isNominal()
Returns true if the attribute is nominal.


isNumerical

boolean isNumerical()
Returns true if the attribute is nominal.


getAsString

java.lang.String getAsString(double value,
                             int digits,
                             boolean quoteNominal)
Returns a formatted string of the given value according to the attribute type.



Copyright © 2001-2009 by Rapid-I