com.rapidminer.operator
Class AbstractIOObject

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
All Implemented Interfaces:
IOObject, java.io.Serializable
Direct Known Subclasses:
ResultObjectAdapter

public abstract class AbstractIOObject
extends java.lang.Object
implements IOObject

This is an abstract superclass for all IOObject. It provides basic implementations for all methods of IOthe interface Object. In addition, it also provides static methods which can be used for reading IOObjects from XML strings and input streams / files containing the XML serialization.

Author:
Ingo Mierswa
See Also:
Serialized Form

Constructor Summary
AbstractIOObject()
           
 
Method Summary
 IOObject copy()
          Returns not a copy but the very same object.
 LoggingHandler getLog()
          Gets the logging associated with the operator currently working on this IOObject or the global log service if no operator was set.
 java.lang.String getSource()
          Returns the source of this IOObject (might return null if the source is unknown).
protected  void initWriting()
          Initializes the writing of this object.
static IOObject read(java.io.InputStream in)
          Deserializes an IOObect from the given XML stream.
 void setLoggingHandler(LoggingHandler loggingHandler)
          Sets the current working operator, i.e. the operator which is currently working on this IOObject.
 void setSource(java.lang.String sourceName)
          Sets the source of this IOObject.
 void write(java.io.OutputStream out)
          Just serializes this object with help of a XMLSerialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIOObject

public AbstractIOObject()
Method Detail

setSource

public void setSource(java.lang.String sourceName)
Sets the source of this IOObject.

Specified by:
setSource in interface IOObject

getSource

public java.lang.String getSource()
Returns the source of this IOObject (might return null if the source is unknown).

Specified by:
getSource in interface IOObject

getLog

public LoggingHandler getLog()
Gets the logging associated with the operator currently working on this IOObject or the global log service if no operator was set.

Specified by:
getLog in interface IOObject

setLoggingHandler

public void setLoggingHandler(LoggingHandler loggingHandler)
Sets the current working operator, i.e. the operator which is currently working on this IOObject. This might be used for example for logging.

Specified by:
setLoggingHandler in interface IOObject

copy

public IOObject copy()
Returns not a copy but the very same object. This is ok for IOObjects which cannot be altered after creation. However, IOObjects which might be changed (e.g. ExampleSets) should overwrite this method and return a proper copy.

Specified by:
copy in interface IOObject

initWriting

protected void initWriting()
Initializes the writing of this object. This method is invoked before the actual writing is performed. The default implementation does nothing. This method should also be used for clean up processes which should be performed before the actual writing is done. For example, models might decide to keep the example set information directly after learning (e.g. for visualization reasons) but not to write them down. Please note that all fields will be written into files unless they are set to null in this method or they are marked as transient.


write

public final void write(java.io.OutputStream out)
                 throws java.io.IOException
Just serializes this object with help of a XMLSerialization. Initializes initWriting() before the actual writing is performed.

Specified by:
write in interface IOObject
Throws:
java.io.IOException

read

public static IOObject read(java.io.InputStream in)
                     throws java.io.IOException
Deserializes an IOObect from the given XML stream.

Throws:
java.io.IOException - if any IO error occurs.
java.lang.IllegalStateException - if XMLSerialization.init(ClassLoader) has never been called.


Copyright © 2001-2009 by Rapid-I