|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.port.AbstractPortObject
public abstract class AbstractPortObject
Abstract implementation of general port objects. Extending this class
(as opposed to just implementing PortObject
) has the advantage that
the serializing methods are enforced by abstract methods (rather than
defining a static method with a particular name as given by the interface).
Subclasses must provide an empty no-arg constructor with public scope (which will be used to restore the content). They are encouraged to also provide a convenience access member such as
public static final PortType TYPE = new PortType(FooModelPortObject.class);and to narrow the return type of the
getSpec()
method. Derived classes don't need to provide a static serializer method as
required by the interface PortObject
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObject |
---|
PortObject.PortObjectSerializer<T extends PortObject> |
Constructor Summary | |
---|---|
AbstractPortObject()
Public no-arg constructor. |
Method Summary | |
---|---|
static PortObject.PortObjectSerializer<AbstractPortObject> |
getPortObjectSerializer()
Abstract serializer method as required by interface PortObject . |
protected abstract void |
load(PortObjectZipInputStream in,
PortObjectSpec spec,
ExecutionMonitor exec)
Loads the content into the freshly instantiated object. |
protected abstract void |
save(PortObjectZipOutputStream out,
ExecutionMonitor exec)
Saves this object to an output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.knime.core.node.port.PortObject |
---|
getSpec, getSummary, getViews |
Constructor Detail |
---|
public AbstractPortObject()
Method Detail |
---|
public static final PortObject.PortObjectSerializer<AbstractPortObject> getPortObjectSerializer()
PortObject
.
protected abstract void save(PortObjectZipOutputStream out, ExecutionMonitor exec) throws IOException, CanceledExecutionException
#savePortObject(PortObject, PortObjectZipOutputStream,
ExecutionMonitor)
.
out
- A clean directory to write to.exec
- For progress/cancelation.
IOException
- If writing fails
CanceledExecutionException
- If canceled.protected abstract void load(PortObjectZipInputStream in, PortObjectSpec spec, ExecutionMonitor exec) throws IOException, CanceledExecutionException
in
- To restore fromspec
- The accompanying spec (which can be safely cast to the
expected class).exec
- For progress/cancelation.
IOException
- If reading fails.
CanceledExecutionException
- If canceled.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |