com.rapidminer.example.set
Class SortedExampleSet

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.example.set.AbstractExampleSet
              extended by com.rapidminer.example.set.SortedExampleSet
All Implemented Interfaces:
ExampleSet, IOObject, ResultObject, Saveable, LoggingHandler, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Example>

public class SortedExampleSet
extends AbstractExampleSet

This example set uses a mapping of indices to access the examples provided by the parent example set. In contrast to the mapped example set, where the sorting would have been disturbed for performance reasons this class simply use the given mapping. A convenience constructor exist to create a view based on the sorting based on a specific attribute.

Author:
Ingo Mierswa
See Also:
Serialized Form

Field Summary
static int DECREASING
           
static int INCREASING
           
static java.lang.String[] SORTING_DIRECTIONS
           
 
Constructor Summary
SortedExampleSet(ExampleSet parent, Attribute sortingAttribute, int sortingDirection)
           
SortedExampleSet(ExampleSet parent, int[] mapping)
          Constructs an example set based on the given sort mapping.
SortedExampleSet(SortedExampleSet exampleSet)
          Clone constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true, if all attributes including labels and other special attributes are equal.
 Attributes getAttributes()
          Returns the data structure holding all attributes.
 Example getExample(int index)
          Returns the i-th example in the mapping.
 ExampleTable getExampleTable()
          Returns the underlying example table.
 int hashCode()
          Returns the hash code of all attributes.
 java.util.Iterator<Example> iterator()
          Returns a SortedExampleReader.
 int size()
          Counts the number of examples.
 
Methods inherited from class com.rapidminer.example.set.AbstractExampleSet
clone, copy, createDataTable, getActions, getExampleFromId, getExampleIndicesFromId, getExtension, getFileDescription, getName, getResultIcon, getStatistics, getStatistics, getVisualizationComponent, getVisualizationComponent, recalculateAllAttributeStatistics, recalculateAttributeStatistics, remapIds, toString, writeAttributeFile, writeDataFile, writeSparseAttributeFile, writeSparseDataFile
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
getLog, getSource, initWriting, read, setLoggingHandler, setSource, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.ResultObject
toResultString
 
Methods inherited from interface com.rapidminer.operator.IOObject
getLog, getSource, setLoggingHandler, setSource, write
 

Field Detail

SORTING_DIRECTIONS

public static final java.lang.String[] SORTING_DIRECTIONS

INCREASING

public static final int INCREASING
See Also:
Constant Field Values

DECREASING

public static final int DECREASING
See Also:
Constant Field Values
Constructor Detail

SortedExampleSet

public SortedExampleSet(ExampleSet parent,
                        Attribute sortingAttribute,
                        int sortingDirection)

SortedExampleSet

public SortedExampleSet(ExampleSet parent,
                        int[] mapping)
Constructs an example set based on the given sort mapping.


SortedExampleSet

public SortedExampleSet(SortedExampleSet exampleSet)
Clone constructor.

Method Detail

equals

public boolean equals(java.lang.Object o)
Description copied from class: AbstractExampleSet
Returns true, if all attributes including labels and other special attributes are equal.

Specified by:
equals in interface ExampleSet
Overrides:
equals in class AbstractExampleSet

hashCode

public int hashCode()
Description copied from class: AbstractExampleSet
Returns the hash code of all attributes.

Specified by:
hashCode in interface ExampleSet
Overrides:
hashCode in class AbstractExampleSet

iterator

public java.util.Iterator<Example> iterator()
Returns a SortedExampleReader.


getExample

public Example getExample(int index)
Returns the i-th example in the mapping.


size

public int size()
Counts the number of examples.


getAttributes

public Attributes getAttributes()
Description copied from interface: ExampleSet
Returns the data structure holding all attributes.


getExampleTable

public ExampleTable getExampleTable()
Description copied from interface: ExampleSet
Returns the underlying example table. Most operators should operate on the example set and manipulate example to change table data instead of using the table directly.



Copyright © 2001-2009 by Rapid-I