com.rapidminer.operator.ports
Interface Port

All Superinterfaces:
Observable<Port>
All Known Subinterfaces:
InputPort, OutputPort
All Known Implementing Classes:
AbstractPort, InputPortImpl, OutputPortImpl

public interface Port
extends Observable<Port>

Operators in a process are connected via input and output ports. Whenever an operator generates output (or meta data about output), it is delivered to the connected input port.
This interface defines all behavior and properies common to input and output ports. This is basically names, description etc., as well as adding messages about problems in the process setup and quick fixes.

Author:
Simon Fischer
See Also:
Ports

Field Summary
static int CLEAR_ALL
           
static int CLEAR_ALL_ERRORS
          Clears all error types.
static int CLEAR_ALL_METADATA
          Clears all meta data, real and inferred.
static int CLEAR_DATA
           
static int CLEAR_META_DATA_ERRORS
           
static int CLEAR_METADATA
           
static int CLEAR_REAL_METADATA
           
static int CLEAR_SIMPLE_ERRORS
           
 
Method Summary
 void addError(MetaDataError metaDataError)
          Report an error in the current process setup.
 void clear(int clearFlags)
          Clears data, meta data and errors at this port.
 java.util.List<QuickFix> collectQuickFixes()
          Returns a sorted list of all quick fixes applicable for this port.
 void freeMemory()
          Releases of any hard reference to IOObjects held by this class.
 IOObject getAnyDataOrNull()
          Returns the last object delivered to the connected InputPort or received from the connected OutputPort.
<T extends IOObject>
T
getData()
          Same as #getData(true).
<T extends IOObject>
T
getData(java.lang.Class<T> desiredClass)
          This method returns the object of the desired class or throws an UserError if no object is present or cannot be casted to the desiredClass
<T extends IOObject>
T
getDataOrNull()
          Returns the last object delivered to the connected InputPort or received from the connected OutputPort
 java.lang.String getDescription()
          Returns a human readable description of the ports pre/ and postconditions.
 java.util.Collection<MetaDataError> getErrors()
          Returns the set of errors added since the last clear errors.
 MetaData getMetaData()
          Returns the meta data currently assigned to this port.
 java.lang.String getName()
          A human readable, unique (operator scope) name for the port.
 Ports<? extends Port> getPorts()
          Returns the set of ports to which this port belongs.
 java.lang.String getShortName()
          Gets a three letter abbreviation of the port's name.
 java.lang.String getSpec()
          Returns the string "OperatorName.PortName".
 boolean isConnected()
          Returns true if connected to another Port.
 boolean isLocked()
           
 void lock()
          Locks the port so port extenders do not remove the port if disconnected.
 boolean simulatesStack()
          Deprecated. The above reasoning turned out to be unnecessary if implementations in other places are correct. We always simulate the stack now. This method is only called from within ExecutionUnit#autoWire(CompatibilityLevel, InputPorts, LinkedList) to keep a reference, but it has no effect on the auto-wiring process. We keep this method until the end of the alpha test phase of Vega.
 void unlock()
           
 
Methods inherited from interface com.rapidminer.tools.Observable
addObserver, addObserverAsFirst, removeObserver
 

Field Detail

CLEAR_META_DATA_ERRORS

static final int CLEAR_META_DATA_ERRORS
See Also:
Constant Field Values

CLEAR_METADATA

static final int CLEAR_METADATA
See Also:
Constant Field Values

CLEAR_DATA

static final int CLEAR_DATA
See Also:
Constant Field Values

CLEAR_SIMPLE_ERRORS

static final int CLEAR_SIMPLE_ERRORS
See Also:
Constant Field Values

CLEAR_REAL_METADATA

static final int CLEAR_REAL_METADATA
See Also:
Constant Field Values

CLEAR_ALL

static final int CLEAR_ALL
See Also:
Constant Field Values

CLEAR_ALL_ERRORS

static final int CLEAR_ALL_ERRORS
Clears all error types.

See Also:
Constant Field Values

CLEAR_ALL_METADATA

static final int CLEAR_ALL_METADATA
Clears all meta data, real and inferred.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
A human readable, unique (operator scope) name for the port.


getMetaData

MetaData getMetaData()
Returns the meta data currently assigned to this port.

Throws:
PortException - if no data is available.

getData

<T extends IOObject> T getData(java.lang.Class<T> desiredClass)
                           throws UserError
This method returns the object of the desired class or throws an UserError if no object is present or cannot be casted to the desiredClass. * @throws UserError if data is missing or of wrong class.

Throws:
UserError

getData

<T extends IOObject> T getData()
                           throws OperatorException
Same as #getData(true).

Throws:
UserError - if data is missing.
OperatorException

getDataOrNull

<T extends IOObject> T getDataOrNull()
                                 throws UserError
Returns the last object delivered to the connected InputPort or received from the connected OutputPort

Throws:
UserError - If data is not of the requested type.

getAnyDataOrNull

IOObject getAnyDataOrNull()
Returns the last object delivered to the connected InputPort or received from the connected OutputPort. Never throws an exception.


getPorts

Ports<? extends Port> getPorts()
Returns the set of ports to which this port belongs.


getShortName

java.lang.String getShortName()
Gets a three letter abbreviation of the port's name.


getDescription

java.lang.String getDescription()
Returns a human readable description of the ports pre/ and postconditions.


isConnected

boolean isConnected()
Returns true if connected to another Port.


addError

void addError(MetaDataError metaDataError)
Report an error in the current process setup.


getErrors

java.util.Collection<MetaDataError> getErrors()
Returns the set of errors added since the last clear errors.


clear

void clear(int clearFlags)
Clears data, meta data and errors at this port.

Parameters:
clearFlags - disjunction of the CLEAR_XX constants.

collectQuickFixes

java.util.List<QuickFix> collectQuickFixes()
Returns a sorted list of all quick fixes applicable for this port.


getSpec

java.lang.String getSpec()
Returns the string "OperatorName.PortName".


simulatesStack

@Deprecated
boolean simulatesStack()
Deprecated. The above reasoning turned out to be unnecessary if implementations in other places are correct. We always simulate the stack now. This method is only called from within ExecutionUnit#autoWire(CompatibilityLevel, InputPorts, LinkedList) to keep a reference, but it has no effect on the auto-wiring process. We keep this method until the end of the alpha test phase of Vega.

Indicates whether ExecutionUnit#autoWire() should simulate the pre RM 5.0 stack behaviour of IOContainer. Normally, ports should return true here. However, ports created by PortPairExtenders should return false here, since (most of the time) they only pass data through rather adding new IOObjects to the IOContainer. TODO: delete


lock

void lock()
Locks the port so port extenders do not remove the port if disconnected. unlocks it.


unlock

void unlock()
See Also:
lock()

isLocked

boolean isLocked()
See Also:
lock()

freeMemory

void freeMemory()
Releases of any hard reference to IOObjects held by this class.



Copyright © 2001-2009 by Rapid-I