com.rapidminer.example
Class SimpleAttributes

java.lang.Object
  extended by com.rapidminer.example.AbstractAttributes
      extended by com.rapidminer.example.SimpleAttributes
All Implemented Interfaces:
Attributes, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Attribute>

public class SimpleAttributes
extends AbstractAttributes

A very basic and simple implementation of the Attributes interface based on a linked list of AttributeRoles and simply delivers the same AttributeRoleIterator which might skip either regular or special attributes.

Author:
Ingo Mierswa
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.rapidminer.example.Attributes
ALL, ATTRIBUTE_NAME, BASE_VALUE, BATCH_NAME, CLASSIFICATION_COST, CLUSTER_NAME, CONFIDENCE_NAME, ID_NAME, KNOWN_ATTRIBUTE_TYPES, LABEL_NAME, OUTLIER_NAME, PREDICTION_NAME, REGULAR, SPECIAL, TYPE_ATTRIBUTE, TYPE_BASE_VALUE, TYPE_BATCH, TYPE_CLUSTER, TYPE_COST, TYPE_ID, TYPE_LABEL, TYPE_OUTLIER, TYPE_PREDICTION, TYPE_WEIGHT, WEIGHT_NAME
 
Constructor Summary
SimpleAttributes()
           
 
Method Summary
 void add(AttributeRole attributeRole)
          Adds a new attribute role.
 java.util.Iterator<AttributeRole> allAttributeRoles()
          Returns an iterator over all attribute roles, including the special attribute roles.
 java.lang.Object clone()
          Returns a clone of this attribute set.
 boolean equals(java.lang.Object o)
          Returns true if the given object is equal to this attribute set.
 AttributeRole findRoleByName(java.lang.String name)
          Finds the AttributeRole belonging to the attribute with the given name (both regular and special).
 AttributeRole findRoleBySpecialName(java.lang.String specialName)
          Finds the AttributeRole with the given special name (both regular and special).
 int hashCode()
          Returns the hash code of this attribute set.
 java.lang.Object readResolve()
           
 boolean remove(AttributeRole attributeRole)
          Removes the given attribute role.
 void rename(AttributeRole attributeRole, java.lang.String newSpecialName)
           
 void rename(Attribute attribute, java.lang.String newName)
          Notifies the Attributes that this attribute will rename itself to the given name immediately after this method returns.
 
Methods inherited from class com.rapidminer.example.AbstractAttributes
addRegular, allAttributes, allSize, clearRegular, clearSpecial, contains, createRegularAttributeArray, get, getCluster, getCost, getId, getLabel, getOutlier, getPredictedLabel, getRegular, getRole, getRole, getSpecial, getWeight, iterator, regularAttributes, remove, replace, setCluster, setCost, setId, setLabel, setOutlier, setPredictedLabel, setSpecialAttribute, setWeight, size, specialAttributes, specialSize, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleAttributes

public SimpleAttributes()
Method Detail

readResolve

public java.lang.Object readResolve()

clone

public java.lang.Object clone()
Description copied from interface: Attributes
Returns a clone of this attribute set.

Specified by:
clone in interface Attributes
Specified by:
clone in class AbstractAttributes

equals

public boolean equals(java.lang.Object o)
Description copied from interface: Attributes
Returns true if the given object is equal to this attribute set.

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

hashCode

public int hashCode()
Description copied from interface: Attributes
Returns the hash code of this attribute set.

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

allAttributeRoles

public java.util.Iterator<AttributeRole> allAttributeRoles()
Description copied from interface: Attributes
Returns an iterator over all attribute roles, including the special attribute roles.


rename

public void rename(AttributeRole attributeRole,
                   java.lang.String newSpecialName)
See Also:
{#rename(Attribute, String)}

rename

public void rename(Attribute attribute,
                   java.lang.String newName)
Description copied from interface: Attributes
Notifies the Attributes that this attribute will rename itself to the given name immediately after this method returns.


add

public void add(AttributeRole attributeRole)
Description copied from interface: Attributes
Adds a new attribute role.


remove

public boolean remove(AttributeRole attributeRole)
Description copied from interface: Attributes
Removes the given attribute role.


findRoleByName

public AttributeRole findRoleByName(java.lang.String name)
Description copied from interface: Attributes
Finds the AttributeRole belonging to the attribute with the given name (both regular and special).


findRoleBySpecialName

public AttributeRole findRoleBySpecialName(java.lang.String specialName)
Description copied from interface: Attributes
Finds the AttributeRole with the given special name (both regular and special).



Copyright © 2001-2009 by Rapid-I