org.embl.ebi.escience.scufl
Class InputPort

java.lang.Object
  extended by org.embl.ebi.escience.scufl.Port
      extended by org.embl.ebi.escience.scufl.InputPort
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.io.Serializable
Direct Known Subclasses:
RservInputPort, RshellInputPort, XMLSplittableInputPort

public class InputPort
extends Port
implements java.io.Serializable, java.awt.datatransfer.Transferable

A port that consumes data on behalf of a processor

Author:
Tom Oinn
See Also:
Serialized Form

Field Summary
static java.awt.datatransfer.DataFlavor FLAVOR
           
static int MERGE
          Combine mode for multiple input links where each distinct input from all upstream links is inserted into a list, ordering is currently not defined
static int NDSELECT
          Non deterministic single select mode for multiple input links where the first link to populate the port with data 'wins' and removes all other links to prevent blocking.
 
Constructor Summary
InputPort(Processor processor, java.lang.String name)
           
 
Method Summary
 java.lang.String[] getControlledVocabulary()
          Get the list of allowed default values
 java.lang.String getDefaultValue()
          Get the default value for this port, or null if there is no default
 int getMergeMode()
          Return the current merge mode for this input port
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df)
          Implements transferable interface
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          Implements transferable interface
 java.lang.Object getWrappedDefaultValue()
          Get the default value wrapped up in however many layers of collections are required.
 boolean hasControlledVocabulary()
          Does this port have a controlled vocab for default values?
 boolean hasDefaultValue()
          Does this input port have a default value?
 boolean isBound()
          Is this input attached to anything?
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
          Implements transferable interface
 boolean isOptional()
          Is this input optional?
 void setControlledVocabulary(java.lang.String[] values)
          Set a controlled list of allowed values for the default
 void setDefaultValue(java.lang.String defaultValue)
          Set the default value for this port, set to null to remove.
 void setMergeMode(int mode)
          Set the merge mode for this input port, this value must currently be one of InputPort.NDSELECT or InputPort.MERGE
 void setOptional(boolean optional)
          Set whether the input is optional (default value if never set is that the input is mandatory)
 
Methods inherited from class org.embl.ebi.escience.scufl.Port
getMetadata, getName, getProcessor, getSyntacticType, isNameEditable, isSink, isSource, setName, setSyntacticType, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAVOR

public static final java.awt.datatransfer.DataFlavor FLAVOR

NDSELECT

public static int NDSELECT
Non deterministic single select mode for multiple input links where the first link to populate the port with data 'wins' and removes all other links to prevent blocking. This is the default behaviour mode for input ports


MERGE

public static int MERGE
Combine mode for multiple input links where each distinct input from all upstream links is inserted into a list, ordering is currently not defined

Constructor Detail

InputPort

public InputPort(Processor processor,
                 java.lang.String name)
          throws DuplicatePortNameException,
                 PortCreationException
Throws:
DuplicatePortNameException
PortCreationException
Method Detail

getMergeMode

public int getMergeMode()
Return the current merge mode for this input port


setMergeMode

public void setMergeMode(int mode)
Set the merge mode for this input port, this value must currently be one of InputPort.NDSELECT or InputPort.MERGE


hasDefaultValue

public boolean hasDefaultValue()
Does this input port have a default value?


getDefaultValue

public java.lang.String getDefaultValue()
Get the default value for this port, or null if there is no default


getWrappedDefaultValue

public java.lang.Object getWrappedDefaultValue()
Get the default value wrapped up in however many layers of collections are required.


setDefaultValue

public void setDefaultValue(java.lang.String defaultValue)
Set the default value for this port, set to null to remove.


setControlledVocabulary

public void setControlledVocabulary(java.lang.String[] values)
Set a controlled list of allowed values for the default


getControlledVocabulary

public java.lang.String[] getControlledVocabulary()
Get the list of allowed default values


hasControlledVocabulary

public boolean hasControlledVocabulary()
Does this port have a controlled vocab for default values?


isOptional

public boolean isOptional()
Is this input optional?


isBound

public boolean isBound()
Is this input attached to anything?


setOptional

public void setOptional(boolean optional)
Set whether the input is optional (default value if never set is that the input is mandatory)


getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Implements transferable interface

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
Implements transferable interface

Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Implements transferable interface

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable