com.rapidminer.operator.ports.impl
Class InputPortImpl

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<Port>
      extended by com.rapidminer.operator.ports.impl.AbstractPort
          extended by com.rapidminer.operator.ports.impl.InputPortImpl
All Implemented Interfaces:
InputPort, Port, Observable<Port>

public class InputPortImpl
extends AbstractPort
implements InputPort

The default implmentation of an InputPort

Author:
Simon Fischer, Sebastian Land

Field Summary
 
Fields inherited from interface com.rapidminer.operator.ports.Port
CLEAR_ALL, CLEAR_ALL_ERRORS, CLEAR_ALL_METADATA, CLEAR_DATA, CLEAR_META_DATA_ERRORS, CLEAR_METADATA, CLEAR_REAL_METADATA, CLEAR_SIMPLE_ERRORS
 
Constructor Summary
protected InputPortImpl(Ports<? extends Port> owner, java.lang.String name, boolean simulatesStack)
          Use the factory method InputPorts#createPort() to create InputPorts.
 
Method Summary
 void addPrecondition(Precondition precondition)
          Adds a precondition to this input port.
 void checkPreconditions()
          Checks all registered preconditions.
 void clear(int clearFlags)
          Clears data, meta data and errors at this port.
 java.util.Collection<Precondition> getAllPreconditions()
          Returns a collection (view) of all preconditions assigned to this InputPort.
 java.lang.String getDescription()
          Returns a human readable description of the ports pre/ and postconditions.
 MetaData getMetaData()
          Returns the meta data received by InputPort.receiveMD(MetaData).
 java.lang.String getPreconditionDescription()
          Returns a human readable representation of the preconditions.
 OutputPort getSource()
          Returns the output port to which this input port is connected.
 boolean isConnected()
          Returns true if connected to another Port.
 boolean isInputCompatible(MetaData input, CompatibilityLevel level)
          Returns true if the given input is compatible with the preconditions.
 void receive(IOObject object)
          Receives data from the output port.
 void receiveMD(MetaData metaData)
          Does the same as #receive(Object) but only with meta data.
 void registerMetaDataChangeListener(MetaDataChangeListener listener)
          This will add the given listener to this port.
 void removeMetaDataChangeListener(MetaDataChangeListener listener)
          Removes the given listener again.
 
Methods inherited from class com.rapidminer.operator.ports.impl.AbstractPort
addError, collectQuickFixes, freeMemory, getAnyDataOrNull, getData, getData, getDataOrNull, getErrors, getName, getPorts, getShortName, getSpec, isLocked, lock, setData, setName, simulatesStack, toString, unlock
 
Methods inherited from class com.rapidminer.tools.AbstractObservable
addObserver, addObserverAsFirst, fireUpdate, fireUpdate, removeObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.ports.Port
addError, collectQuickFixes, freeMemory, getAnyDataOrNull, getData, getData, getDataOrNull, getErrors, getName, getPorts, getShortName, getSpec, isLocked, lock, simulatesStack, unlock
 
Methods inherited from interface com.rapidminer.tools.Observable
addObserver, addObserverAsFirst, removeObserver
 

Constructor Detail

InputPortImpl

protected InputPortImpl(Ports<? extends Port> owner,
                        java.lang.String name,
                        boolean simulatesStack)
Use the factory method InputPorts#createPort() to create InputPorts.

Method Detail

clear

public void clear(int clearFlags)
Description copied from interface: Port
Clears data, meta data and errors at this port.

Specified by:
clear in interface Port
Overrides:
clear in class AbstractPort
Parameters:
clearFlags - disjunction of the CLEAR_XX constants.

receive

public void receive(IOObject object)
Description copied from interface: InputPort
Receives data from the output port. Throws an PortException if data has already been set. (Called by OuptutPort#deliver(Object). *

Specified by:
receive in interface InputPort

receiveMD

public void receiveMD(MetaData metaData)
Description copied from interface: InputPort
Does the same as #receive(Object) but only with meta data.

Specified by:
receiveMD in interface InputPort

getMetaData

public MetaData getMetaData()
Description copied from interface: InputPort
Returns the meta data received by InputPort.receiveMD(MetaData).

Specified by:
getMetaData in interface InputPort
Specified by:
getMetaData in interface Port

getSource

public OutputPort getSource()
Description copied from interface: InputPort
Returns the output port to which this input port is connected.

Specified by:
getSource in interface InputPort

addPrecondition

public void addPrecondition(Precondition precondition)
Description copied from interface: InputPort
Adds a precondition to this input port.

Specified by:
addPrecondition in interface InputPort

checkPreconditions

public void checkPreconditions()
Description copied from interface: InputPort
Checks all registered preconditions.

Specified by:
checkPreconditions in interface InputPort

getPreconditionDescription

public java.lang.String getPreconditionDescription()
Description copied from interface: InputPort
Returns a human readable representation of the preconditions.

Specified by:
getPreconditionDescription in interface InputPort

isInputCompatible

public boolean isInputCompatible(MetaData input,
                                 CompatibilityLevel level)
Description copied from interface: InputPort
Returns true if the given input is compatible with the preconditions.

Specified by:
isInputCompatible in interface InputPort

getDescription

public java.lang.String getDescription()
Description copied from interface: Port
Returns a human readable description of the ports pre/ and postconditions.

Specified by:
getDescription in interface Port

isConnected

public boolean isConnected()
Description copied from interface: Port
Returns true if connected to another Port.

Specified by:
isConnected in interface Port

getAllPreconditions

public java.util.Collection<Precondition> getAllPreconditions()
Description copied from interface: InputPort
Returns a collection (view) of all preconditions assigned to this InputPort.

Specified by:
getAllPreconditions in interface InputPort

registerMetaDataChangeListener

public void registerMetaDataChangeListener(MetaDataChangeListener listener)
Description copied from interface: InputPort
This will add the given listener to this port. It is informed whenever the method InputPort.receiveMD(MetaData) is called.

Specified by:
registerMetaDataChangeListener in interface InputPort

removeMetaDataChangeListener

public void removeMetaDataChangeListener(MetaDataChangeListener listener)
Description copied from interface: InputPort
Removes the given listener again.

Specified by:
removeMetaDataChangeListener in interface InputPort


Copyright © 2001-2009 by Rapid-I