Package adams.flow.standalone.rats.input
Class AbstractMetaRatInput
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.standalone.rats.input.AbstractRatInput
-
- adams.flow.standalone.rats.input.AbstractMetaRatInput
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler,adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.ShallowCopySupporter<AbstractRatInput>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.core.StoppableWithFeedback,RatInput,Serializable
- Direct Known Subclasses:
Cron,InputPolling,InputWithCallableTransformer,InputWithExternalTransformer
public abstract class AbstractMetaRatInput extends AbstractRatInput
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayListm_Datathe data queue.protected RatInputm_Inputthe base RatInput to use.-
Fields inherited from class adams.flow.standalone.rats.input.AbstractRatInput
m_LoggingPrefix, m_Owner, m_ReceptionInterrupted, m_ReceptionRunning, m_Stopped
-
-
Constructor Summary
Constructors Constructor Description AbstractMetaRatInput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcallReceive()Hook method that calls the base-input's receive() method.voiddefineOptions()Adds options to the internal list of options.protected StringdoReceive()Performs the actual reception of data.RatInputgetInput()Returns the base receiver to use.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.booleanhasPendingOutput()Checks whether any output can be collected.protected voidinitialize()Initializes the members.StringinitReception()Initializes the reception.StringinputTipText()Returns the tip text for this property.Objectoutput()Returns the received data.protected StringpostReceive()Hook method after calling the base-input's receive() method.protected StringpreReceive()Hook method before calling the base-input's receive() method.voidsetInput(RatInput value)Sets the base receiver to use.voidsetOwner(Rat value)Sets the actor the receiver belongs to.StringsetUp()Hook method for performing checks at setup time.voidstopExecution()Stops the execution.-
Methods inherited from class adams.flow.standalone.rats.input.AbstractRatInput
canReceive, check, cleanUp, configureLogger, doWait, generates, getAdditionalInformation, getFullName, getOwner, getQueue, getReceptionInterrupted, handleException, interruptReception, isReceptionRunning, isStopped, receive, shallowCopy, shallowCopy, updatePrefix
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractRatInput
-
setOwner
public void setOwner(Rat value)
Sets the actor the receiver belongs to.- Specified by:
setOwnerin interfaceRatInput- Overrides:
setOwnerin classAbstractRatInput- Parameters:
value- the owner
-
setInput
public void setInput(RatInput value)
Sets the base receiver to use.- Parameters:
value- the receiver
-
getInput
public RatInput getInput()
Returns the base receiver to use.- Returns:
- the receiver
-
inputTipText
public String inputTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classAbstractRatInput- Returns:
- null if no info available, otherwise short string
-
setUp
public String setUp()
Hook method for performing checks at setup time.- Specified by:
setUpin interfaceRatInput- Overrides:
setUpin classAbstractRatInput- Returns:
- null if successful, otherwise error message
-
initReception
public String initReception()
Initializes the reception.- Specified by:
initReceptionin interfaceRatInput- Overrides:
initReceptionin classAbstractRatInput- Returns:
- null if successfully initialized, otherwise error message
-
preReceive
protected String preReceive()
Hook method before calling the base-input's receive() method.
Default implementation just clears the data queue.- Returns:
- null if successful, otherwise error message
- See Also:
m_Data
-
callReceive
protected String callReceive()
Hook method that calls the base-input's receive() method.- Returns:
- null if successful, otherwise error message
-
postReceive
protected String postReceive()
Hook method after calling the base-input's receive() method.
Default implementation collects all the pending data from the base-input.- Returns:
- null if successful, otherwise error message
- See Also:
m_Data
-
doReceive
protected String doReceive()
Performs the actual reception of data.- Specified by:
doReceivein classAbstractRatInput- Returns:
- null if successful, otherwise error message
- See Also:
preReceive(),callReceive(),postReceive()
-
hasPendingOutput
public boolean hasPendingOutput()
Checks whether any output can be collected.- Specified by:
hasPendingOutputin interfaceRatInput- Specified by:
hasPendingOutputin classAbstractRatInput- Returns:
- true if output available
-
output
public Object output()
Returns the received data.- Specified by:
outputin interfaceRatInput- Specified by:
outputin classAbstractRatInput- Returns:
- the data
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceRatInput- Specified by:
stopExecutionin interfaceadams.core.Stoppable- Overrides:
stopExecutionin classAbstractRatInput
-
-