com.rapidminer.example.table
Class AttributeFactory

java.lang.Object
  extended by com.rapidminer.example.table.AttributeFactory

public class AttributeFactory
extends java.lang.Object

This class is used to create and clone attributes. It should be used to create attributes instead of directly creating them by using constructors. Additionally, it provides some helper methods for attribute creation purposes (name creation, block numbers,...).

Author:
Ingo Mierswa Exp $

Constructor Summary
AttributeFactory()
           
 
Method Summary
static Attribute changeValueType(Attribute attribute, int valueType)
          Changes the value type of the given attribute and returns a new attribute with the same properties but the new value type.
static Attribute createAttribute(Attribute attribute)
          Simple clone factory method for attributes.
static Attribute createAttribute(Attribute attribute, java.lang.String functionName)
          Simple clone factory method for attributes.
static Attribute createAttribute(int valueType)
          Creates a simple single attribute depending on the given value type.
static Attribute createAttribute(int valueType, int blockType, java.lang.String constructionDescription)
          Creates a simple attribute depending on the given value type.
static Attribute createAttribute(java.lang.String name, int valueType)
          Creates a simple single attribute depending on the given value type.
static Attribute createAttribute(java.lang.String name, int valueType, int blockType)
          Creates a simple attribute depending on the given value type.
static java.lang.String createName()
          Creates a new unsused attribute name.
static java.lang.String createName(java.lang.String prefix)
          Creates a new unsused attribute name with a given prefix.
static void resetNameCounters()
          Resets the counters for the generated attribute names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeFactory

public AttributeFactory()
Method Detail

createAttribute

public static Attribute createAttribute(java.lang.String name,
                                        int valueType)
Creates a simple single attribute depending on the given value type.


createAttribute

public static Attribute createAttribute(int valueType)
Creates a simple single attribute depending on the given value type. The name is randomly created. This attribute can also be used for generators to define their desired input attributes for compatibility checks.


createAttribute

public static Attribute createAttribute(int valueType,
                                        int blockType,
                                        java.lang.String constructionDescription)
Creates a simple attribute depending on the given value type.


createAttribute

public static Attribute createAttribute(java.lang.String name,
                                        int valueType,
                                        int blockType)
Creates a simple attribute depending on the given value type.


createAttribute

public static Attribute createAttribute(Attribute attribute)
Simple clone factory method for attributes. Invokes createAttribute(Attribute att, String name) with name = null.


createAttribute

public static Attribute createAttribute(Attribute attribute,
                                        java.lang.String functionName)
Simple clone factory method for attributes. Returns the clone of the given attribute and sets the function name to the given one if not null. In this case the attribute is used as an argument of returned attribute. This method might be usefull for example to create a prediction attribute with the same properties as the original label attribute.


changeValueType

public static Attribute changeValueType(Attribute attribute,
                                        int valueType)
Changes the value type of the given attribute and returns a new attribute with the same properties but the new value type. Since values within examples are not altered it is not suggested to use this method to change attributes within an exampleset in use. Operators should create a new attribute to ensure parallel executability.


resetNameCounters

public static void resetNameCounters()
Resets the counters for the generated attribute names.


createName

public static java.lang.String createName()
Creates a new unsused attribute name.


createName

public static java.lang.String createName(java.lang.String prefix)
Creates a new unsused attribute name with a given prefix.



Copyright © 2001-2009 by Rapid-I