com.rapidminer
Class Process

java.lang.Object
  extended by com.rapidminer.Process
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Experiment

public class Process
extends java.lang.Object
implements java.lang.Cloneable

This class was introduced to avoid confusing handling of operator maps and other stuff when a new process definition is created. It is also necessary for file name resolving and breakpoint handling.

If you want to use RapidMiner from your own application the best way is often to create a process definition from the scratch (by adding the complete operator tree to the process' root operator) or from a file (for example created with the GUI beforehand) and start it by invoking the run() method.

Author:
Ingo Mierswa

Field Summary
static int PROCESS_STATE_PAUSED
           
static int PROCESS_STATE_RUNNING
           
static int PROCESS_STATE_STOPPED
           
static int PROCESS_STATE_UNKNOWN
           
 
Constructor Summary
Process()
          Constructs an process consisting only of a SimpleOperatorChain.
Process(java.io.File file)
          Creates a new process from the given process file.
Process(java.io.InputStream in)
          Reads an process configuration from the given stream.
Process(java.io.Reader in)
          Reads an process configuration from the given reader.
Process(java.lang.String xmlString)
          Reads an process configuration from an XML String.
Process(java.net.URL url)
          Reads an process configuration from the given URL.
 
Method Summary
 void addBreakpointListener(BreakpointListener listener)
          Removes a breakpoint listener.
 void addDataTable(DataTable table)
          Adds the given data table.
 void addLoggingListener(LoggingListener loggingListener)
          Adds the given logging listener.
 void addReportStream(ReportStream stream)
          This method adds a new report stream with the given name
 boolean checkExperiment(IOContainer inputContainer)
          Deprecated. Use checkProcess(IOContainer) instead
 boolean checkProcess(IOContainer inputContainer)
          Checks for correct number of inner operators, properties, and io.
 void clearDataTable(java.lang.String name)
          Clears a single data table, i.e. removes all entries.
 void clearMacros()
          Clears all macros.
 void clearReportStreams()
           
 void clearStorage()
          Clears all macros.
 void clearUnknownParameters()
          Clears the information about unknown parameter types which occurred during process creation (from streams or files).
 java.lang.Object clone()
           
 boolean dataTableExists(java.lang.String name)
          Returns true if a data table object with the given name exists.
 void deleteDataTable(java.lang.String name)
          Deletes a single data table.
 void fireResumeEvent()
          Fires the event that the process was resumed.
 java.util.Collection<java.lang.String> getAllOperatorNames()
          Returns a Set view of all operator names (i.e.
 java.util.Collection<Operator> getAllOperators()
          Returns a Collection view of all operators.
 Operator getCurrentOperator()
          Returns the operator that is currently being executed.
 DataTable getDataTable(java.lang.String name)
          Returns the data table associated with the given name.
 java.util.Collection<DataTable> getDataTables()
          Returns all data tables.
static java.nio.charset.Charset getEncoding(java.lang.String encoding)
           
 java.io.File getExperimentFile()
          Deprecated. Use getProcessFile() instead
 int getExperimentState()
          Deprecated. Use getProcessState() instead
 LogService getLog()
           
 MacroHandler getMacroHandler()
          Returns the macro handler.
 Operator getOperator(java.lang.String name)
          Returns the operator with the given name.
 java.io.File getProcessFile()
          Returns the current process file.
 int getProcessState()
           
 ReportStream getReportStream(java.lang.String name)
          Returns the reportStream with given name
 ProcessRootOperator getRootOperator()
          Delivers the current root operator.
 java.util.List<UnknownParameterInformation> getUnknownParameters()
          Delivers the information about unknown parameter types which occurred during process creation (from streams or files).
 int notifyRenaming(java.lang.String oldName, java.lang.String newName)
           
 void pause(Operator operator, IOContainer iocontainer, int breakpointType)
          Pauses the process at a breakpoint.
 void readProcess(java.io.Reader in)
          Reads the process setup from the given input stream.
 java.lang.String registerName(java.lang.String name, Operator operator)
          Returns a "name (i)" if name is already in use.
 void removeBreakpointListener(BreakpointListener listener)
          Adds a breakpoint listener.
 void removeLoggingListener(LoggingListener loggingListener)
          Removes the given logging listener.
 void removeReportStream(java.lang.String name)
          Removes this reportStream from process.
 java.io.File resolveFileName(java.lang.String name)
          Resolves the given filename against the directory containing the process file.
 void resume()
          Resumes the process after it has been paused.
 IOObject retrieve(java.lang.String name, boolean remove)
          Retrieves the stored object.
 IOContainer run()
          Starts the process with no input.
 IOContainer run(int logVerbosity)
          Starts the process with the given log verbosity.
 IOContainer run(IOContainer input)
          Starts the process with the given input.
 IOContainer run(IOContainer input, boolean cleanUp)
          Starts the process with the given input.
 IOContainer run(IOContainer input, int logVerbosity)
          Starts the process with the given input.
 IOContainer run(IOContainer input, int logVerbosity, boolean cleanUp)
          Starts the process with the given input.
 void save()
          Saves the process to the process file.
 void save(java.io.File file)
          Saves the process to the given process file.
 void setCurrentOperator(Operator operator)
          Returns the operator that is currently being executed.
 void setExperimentFile(java.io.File file)
          Deprecated. Please use setProcessFile(File) instead.
 void setExperimentState(int state)
          Deprecated. Use setProcessState(int) instead
 void setProcessFile(java.io.File file)
          Sets the process file.
 void setRootOperator(ProcessRootOperator root)
          Sets the current root operator.
 void setupFromXML(java.lang.String xmlString)
          Creates the process from the given XML.
 boolean shouldStop()
          Returns true iff the process should be stopped.
 void stop()
          Stops the process as soon as possible.
 void store(java.lang.String name, IOObject object)
          Returns the macro handler.
 java.lang.String toString()
           
 void unregisterName(java.lang.String name)
          This method is used for unregistering a name from the operator name map.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROCESS_STATE_UNKNOWN

public static final int PROCESS_STATE_UNKNOWN
See Also:
Constant Field Values

PROCESS_STATE_STOPPED

public static final int PROCESS_STATE_STOPPED
See Also:
Constant Field Values

PROCESS_STATE_PAUSED

public static final int PROCESS_STATE_PAUSED
See Also:
Constant Field Values

PROCESS_STATE_RUNNING

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

Process

public Process()
Constructs an process consisting only of a SimpleOperatorChain.


Process

public Process(java.io.File file)
        throws java.io.IOException,
               XMLException
Creates a new process from the given process file. This might have been created with the GUI beforehand.

Throws:
java.io.IOException
XMLException

Process

public Process(java.lang.String xmlString)
        throws java.io.IOException,
               XMLException
Reads an process configuration from an XML String.

Throws:
java.io.IOException
XMLException

Process

public Process(java.io.Reader in)
        throws java.io.IOException,
               XMLException
Reads an process configuration from the given reader.

Throws:
java.io.IOException
XMLException

Process

public Process(java.io.InputStream in)
        throws java.io.IOException,
               XMLException
Reads an process configuration from the given stream.

Throws:
java.io.IOException
XMLException

Process

public Process(java.net.URL url)
        throws java.io.IOException,
               XMLException
Reads an process configuration from the given URL.

Throws:
java.io.IOException
XMLException
Method Detail

setupFromXML

public void setupFromXML(java.lang.String xmlString)
                  throws java.io.IOException,
                         XMLException
Creates the process from the given XML.

Throws:
java.io.IOException
XMLException

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

setExperimentState

@Deprecated
public void setExperimentState(int state)
Deprecated. Use setProcessState(int) instead


getExperimentState

@Deprecated
public int getExperimentState()
Deprecated. Use getProcessState() instead


getProcessState

public int getProcessState()

getLog

public LogService getLog()

getMacroHandler

public MacroHandler getMacroHandler()
Returns the macro handler.


clearMacros

public void clearMacros()
Clears all macros.


store

public void store(java.lang.String name,
                  IOObject object)
Returns the macro handler.


retrieve

public IOObject retrieve(java.lang.String name,
                         boolean remove)
Retrieves the stored object.


clearStorage

public void clearStorage()
Clears all macros.


addLoggingListener

public void addLoggingListener(LoggingListener loggingListener)
Adds the given logging listener.


removeLoggingListener

public void removeLoggingListener(LoggingListener loggingListener)
Removes the given logging listener.


dataTableExists

public boolean dataTableExists(java.lang.String name)
Returns true if a data table object with the given name exists.


addDataTable

public void addDataTable(DataTable table)
Adds the given data table.


clearDataTable

public void clearDataTable(java.lang.String name)
Clears a single data table, i.e. removes all entries.


deleteDataTable

public void deleteDataTable(java.lang.String name)
Deletes a single data table.


getDataTable

public DataTable getDataTable(java.lang.String name)
Returns the data table associated with the given name. If the name was not used yet, an empty DataTable object is created with the given columnNames.


getDataTables

public java.util.Collection<DataTable> getDataTables()
Returns all data tables.


addReportStream

public void addReportStream(ReportStream stream)
This method adds a new report stream with the given name


getReportStream

public ReportStream getReportStream(java.lang.String name)
Returns the reportStream with given name


removeReportStream

public void removeReportStream(java.lang.String name)
Removes this reportStream from process. This report Stream will not be notified about new report items.

Parameters:
name - of the report stream given in the ReportGenerator operator

clearReportStreams

public void clearReportStreams()

setRootOperator

public void setRootOperator(ProcessRootOperator root)
Sets the current root operator. This might lead to a new registering of operator names.


getRootOperator

public ProcessRootOperator getRootOperator()
Delivers the current root operator.


getExperimentFile

@Deprecated
public java.io.File getExperimentFile()
Deprecated. Use getProcessFile() instead

Returns the current process file.


getProcessFile

public java.io.File getProcessFile()
Returns the current process file.


getOperator

public Operator getOperator(java.lang.String name)
Returns the operator with the given name.


getCurrentOperator

public Operator getCurrentOperator()
Returns the operator that is currently being executed.


getAllOperators

public java.util.Collection<Operator> getAllOperators()
Returns a Collection view of all operators.


getAllOperatorNames

public java.util.Collection<java.lang.String> getAllOperatorNames()
Returns a Set view of all operator names (i.e. Strings).


setCurrentOperator

public void setCurrentOperator(Operator operator)
Returns the operator that is currently being executed.


pause

public void pause(Operator operator,
                  IOContainer iocontainer,
                  int breakpointType)
Pauses the process at a breakpoint.


resume

public void resume()
Resumes the process after it has been paused.


stop

public void stop()
Stops the process as soon as possible.


shouldStop

public boolean shouldStop()
Returns true iff the process should be stopped.


addBreakpointListener

public void addBreakpointListener(BreakpointListener listener)
Removes a breakpoint listener.


removeBreakpointListener

public void removeBreakpointListener(BreakpointListener listener)
Adds a breakpoint listener.


fireResumeEvent

public void fireResumeEvent()
Fires the event that the process was resumed.


getUnknownParameters

public java.util.List<UnknownParameterInformation> getUnknownParameters()
Delivers the information about unknown parameter types which occurred during process creation (from streams or files).


clearUnknownParameters

public void clearUnknownParameters()
Clears the information about unknown parameter types which occurred during process creation (from streams or files).


checkExperiment

@Deprecated
public boolean checkExperiment(IOContainer inputContainer)
Deprecated. Use checkProcess(IOContainer) instead

Checks for correct number of inner operators, properties, and io.


checkProcess

public boolean checkProcess(IOContainer inputContainer)
Checks for correct number of inner operators, properties, and io.


run

public final IOContainer run()
                      throws OperatorException
Starts the process with no input.

Throws:
OperatorException

run

public final IOContainer run(int logVerbosity)
                      throws OperatorException
Starts the process with the given log verbosity.

Throws:
OperatorException

run

public final IOContainer run(IOContainer input)
                      throws OperatorException
Starts the process with the given input.

Throws:
OperatorException

run

public final IOContainer run(IOContainer input,
                             int logVerbosity)
                      throws OperatorException
Starts the process with the given input. The process uses the given log verbosity.

Throws:
OperatorException

run

public final IOContainer run(IOContainer input,
                             boolean cleanUp)
                      throws OperatorException
Starts the process with the given input. The process uses a default log verbosity. The boolean flag indicates if some static initializations should be cleaned before the process is started. This should usually be true but it might be useful to set this to false if, for example, several process runs uses the same object visualizer which would have been cleaned otherwise.

Throws:
OperatorException

run

public final IOContainer run(IOContainer input,
                             int logVerbosity,
                             boolean cleanUp)
                      throws OperatorException
Starts the process with the given input. The process uses the given log verbosity. The boolean flag indicates if some static initializations should be cleaned before the process is started. This should usually be true but it might be useful to set this to false if, for example, several process runs uses the same object visualizer which would have been cleaned otherwise.

Throws:
OperatorException

getEncoding

public static java.nio.charset.Charset getEncoding(java.lang.String encoding)

save

public void save()
          throws java.io.IOException
Saves the process to the process file.

Throws:
java.io.IOException

save

public void save(java.io.File file)
          throws java.io.IOException
Saves the process to the given process file.

Throws:
java.io.IOException

setExperimentFile

@Deprecated
public void setExperimentFile(java.io.File file)
Deprecated. Please use setProcessFile(File) instead.

Sets the process file. This file might be used for resolving relative filenames.


setProcessFile

public void setProcessFile(java.io.File file)
Sets the process file. This file might be used for resolving relative filenames.


resolveFileName

public java.io.File resolveFileName(java.lang.String name)
Resolves the given filename against the directory containing the process file.


readProcess

public void readProcess(java.io.Reader in)
                 throws XMLException,
                        java.io.IOException
Reads the process setup from the given input stream.

Throws:
XMLException
java.io.IOException

registerName

public java.lang.String registerName(java.lang.String name,
                                     Operator operator)
Returns a "name (i)" if name is already in use. This new name should then be used as operator name.


unregisterName

public void unregisterName(java.lang.String name)
This method is used for unregistering a name from the operator name map.


notifyRenaming

public int notifyRenaming(java.lang.String oldName,
                          java.lang.String newName)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 by Rapid-I