|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.port.AbstractSimplePortObject
public abstract class AbstractSimplePortObject
Abstract implementation of basic port objects that save and load themselves
from ModelContentRO
objects. This class should be used in cases where
the content of a model can be easily broke up into basic types (such as
String, int, double, ...) and array of those.
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 (most commonly used are specs of type
DataTableSpec
, whereby the columns reflect the
required input attributes of a model), or
AbstractSimplePortObjectSpec
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 | |
---|---|
AbstractSimplePortObject()
Public no-arg constructor. |
Method Summary | |
---|---|
boolean |
equals(Object oport)
Method compares both ModelContent objects that first need
to be saved by calling save(ModelContentWO, ExecutionMonitor) . |
static PortObject.PortObjectSerializer<AbstractSimplePortObject> |
getPortObjectSerializer()
Abstract serializer method as required by interface PortObject . |
JComponent[] |
getViews()
The returned views are displayed in the out port view of the referring node. |
int |
hashCode()
Method computes the hash code as defined by the underlying ModelContent object that first need to be saved by calling
save(ModelContentWO, ExecutionMonitor) . |
protected abstract void |
load(ModelContentRO model,
PortObjectSpec spec,
ExecutionMonitor exec)
Loads the content into the freshly instantiated object. |
protected abstract void |
save(ModelContentWO model,
ExecutionMonitor exec)
Saves this object to model content object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.knime.core.node.port.PortObject |
---|
getSpec, getSummary |
Constructor Detail |
---|
public AbstractSimplePortObject()
Method Detail |
---|
public static final PortObject.PortObjectSerializer<AbstractSimplePortObject> getPortObjectSerializer()
PortObject
.
protected abstract void save(ModelContentWO model, ExecutionMonitor exec) throws CanceledExecutionException
model
- To save to.exec
- For progress/cancelation.
CanceledExecutionException
- If canceled.protected abstract void load(ModelContentRO model, PortObjectSpec spec, ExecutionMonitor exec) throws InvalidSettingsException, CanceledExecutionException
model
- To load from.spec
- The accompanying spec (which can be safely cast to the
expected class).exec
- For progress/cancelation.
InvalidSettingsException
- If settings are incomplete/deficient.
CanceledExecutionException
- If canceled.public JComponent[] getViews()
getViews
in interface PortObject
public boolean equals(Object oport)
ModelContent
objects that first need
to be saved by calling save(ModelContentWO, ExecutionMonitor)
.
Override this method in order to compare both objects more efficiently.
equals
in class Object
public int hashCode()
ModelContent
object that first need to be saved by calling
save(ModelContentWO, ExecutionMonitor)
. Override this method in
order to compute the hash code more efficiently.
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |