com.rapidminer.example.table
Class ViewAttribute

java.lang.Object
  extended by com.rapidminer.example.table.AbstractAttribute
      extended by com.rapidminer.example.table.ViewAttribute
All Implemented Interfaces:
Attribute, java.io.Serializable, java.lang.Cloneable

public class ViewAttribute
extends AbstractAttribute

A view attribute is based on a ViewModel (Preprocessing Model) and applies the model on the fly.

Author:
Sebastian Land
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.rapidminer.example.Attribute
MISSING_NOMINAL_VALUE, UNDEFINED_ATTRIBUTE_INDEX, VIEW_ATTRIBUTE_INDEX
 
Constructor Summary
ViewAttribute(ViewModel model, Attribute parent, java.lang.String name, int valueType, NominalMapping mapping)
           
 
Method Summary
 java.lang.Object clone()
          Clones this attribute.
 java.lang.String getAsString(double value, int numberOfDigits, boolean quoteNominal)
          Returns a formatted string of the given value according to the attribute type.
 NominalMapping getMapping()
          Returns the nominal mapping between nominal values and internal double representations.
 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.
 boolean isNominal()
          Returns true if the attribute is nominal.
 boolean isNumerical()
          Returns true if the attribute is nominal.
 void setMapping(NominalMapping nominalMapping)
          Returns the nominal mapping between nominal values and internal double representations.
 
Methods inherited from class com.rapidminer.example.table.AbstractAttribute
addOwner, addTransformation, clearTransformations, equals, getAllStatistics, getAnnotations, getBlockType, getConstruction, getDefault, getLastTransformation, getName, getStatistics, getStatistics, getValueType, hashCode, registerStatistics, removeOwner, setBlockType, setConstruction, setDefault, setName, setTableIndex, setValue, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ViewAttribute

public ViewAttribute(ViewModel model,
                     Attribute parent,
                     java.lang.String name,
                     int valueType,
                     NominalMapping mapping)
Method Detail

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
Overrides:
getValue in class AbstractAttribute

clone

public java.lang.Object clone()
Description copied from class: AbstractAttribute
Clones this attribute.

Specified by:
clone in interface Attribute
Specified by:
clone in class AbstractAttribute

getAsString

public java.lang.String getAsString(double value,
                                    int numberOfDigits,
                                    boolean quoteNominal)
Description copied from interface: Attribute
Returns a formatted string of the given value according to the attribute type.


getMapping

public NominalMapping getMapping()
Description copied from interface: Attribute
Returns the nominal mapping between nominal values and internal double representations. Please note that invoking this method might result in an UnsupportedOperationException for non-nominal attributes.


isNominal

public boolean isNominal()
Description copied from interface: Attribute
Returns true if the attribute is nominal.


isNumerical

public boolean isNumerical()
Description copied from interface: Attribute
Returns true if the attribute is nominal.


setMapping

public void setMapping(NominalMapping nominalMapping)
Description copied from interface: Attribute
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.


getTableIndex

public int getTableIndex()
Description copied from class: AbstractAttribute
Returns the index in the example table.

Specified by:
getTableIndex in interface Attribute
Overrides:
getTableIndex in class AbstractAttribute


Copyright © 2001-2009 by Rapid-I