com.rapidminer.example.set
Class SingleExampleExampleSet

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.SingleExampleExampleSet
All Implemented Interfaces:
ExampleSet, IOObject, ResultObject, LoggingHandler, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Example>

public class SingleExampleExampleSet
extends AbstractExampleSet

This view can be used to wrap a single example.

Author:
Ingo Mierswa
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.rapidminer.operator.AbstractIOObject
AbstractIOObject.InputStreamProvider
 
Constructor Summary
SingleExampleExampleSet(ExampleSet exampleSet, Example example)
           
SingleExampleExampleSet(SingleExampleExampleSet exampleSet)
           
 
Method Summary
 Attributes getAttributes()
          Returns the data structure holding all attributes.
 Example getExample(int index)
          Returns the i-th example.
 Example getExampleFromId(double id)
          Returns the example with the given id value.
 ExampleTable getExampleTable()
          Returns the underlying example table.
 java.util.Iterator<Example> iterator()
           
 int size()
          Returns the number of examples in this example set.
 
Methods inherited from class com.rapidminer.example.set.AbstractExampleSet
clone, copy, createDataTable, equals, getExampleIndicesFromId, getExtension, getFileDescription, getName, getStatistics, getStatistics, hashCode, recalculateAllAttributeStatistics, recalculateAttributeStatistics, remapIds, toString, writeAttributeFile, writeDataFile, writeSparseAttributeFile, writeSparseDataFile
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, getActions, getAnnotations, getResultIcon, log, log, logError, logNote, logWarning, toHTML, toResultString
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
appendOperatorToHistory, getLog, getProcessingHistory, getSource, initWriting, read, read, read, 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
getActions, getResultIcon, toResultString
 
Methods inherited from interface com.rapidminer.operator.IOObject
appendOperatorToHistory, getAnnotations, getLog, getProcessingHistory, getSource, setLoggingHandler, setSource, write
 

Constructor Detail

SingleExampleExampleSet

public SingleExampleExampleSet(ExampleSet exampleSet,
                               Example example)

SingleExampleExampleSet

public SingleExampleExampleSet(SingleExampleExampleSet exampleSet)
Method Detail

iterator

public java.util.Iterator<Example> iterator()

getExample

public Example getExample(int index)
Description copied from interface: ExampleSet
Returns the i-th example. It is not guaranteed that asking for an example by using the index in the example table is efficiently implemented. Therefore for-loops for iterations are not an option and an ExampleReader should be used.


size

public int size()
Description copied from interface: ExampleSet
Returns the number of examples in this example set. This number should not be used to create for-loops to iterate through all examples.


getExampleFromId

public Example getExampleFromId(double id)
Description copied from interface: ExampleSet
Returns the example with the given id value. If the example set does not contain an id attribute this method should return null. Call ExampleSet.remapIds() before using this method.

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

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