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 ArrayList
m_Data
the data queue.protected RatInput
m_Input
the 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 String
callReceive()
Hook method that calls the base-input's receive() method.void
defineOptions()
Adds options to the internal list of options.protected String
doReceive()
Performs the actual reception of data.RatInput
getInput()
Returns the base receiver to use.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.boolean
hasPendingOutput()
Checks whether any output can be collected.protected void
initialize()
Initializes the members.String
initReception()
Initializes the reception.String
inputTipText()
Returns the tip text for this property.Object
output()
Returns the received data.protected String
postReceive()
Hook method after calling the base-input's receive() method.protected String
preReceive()
Hook method before calling the base-input's receive() method.void
setInput(RatInput value)
Sets the base receiver to use.void
setOwner(Rat value)
Sets the actor the receiver belongs to.String
setUp()
Hook method for performing checks at setup time.void
stopExecution()
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:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractRatInput
-
setOwner
public void setOwner(Rat value)
Sets the actor the receiver belongs to.- Specified by:
setOwner
in interfaceRatInput
- Overrides:
setOwner
in 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:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractRatInput
- Returns:
- null if no info available, otherwise short string
-
setUp
public String setUp()
Hook method for performing checks at setup time.- Specified by:
setUp
in interfaceRatInput
- Overrides:
setUp
in classAbstractRatInput
- Returns:
- null if successful, otherwise error message
-
initReception
public String initReception()
Initializes the reception.- Specified by:
initReception
in interfaceRatInput
- Overrides:
initReception
in 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:
doReceive
in 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:
hasPendingOutput
in interfaceRatInput
- Specified by:
hasPendingOutput
in classAbstractRatInput
- Returns:
- true if output available
-
output
public Object output()
Returns the received data.- Specified by:
output
in interfaceRatInput
- Specified by:
output
in classAbstractRatInput
- Returns:
- the data
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceRatInput
- Specified by:
stopExecution
in interfaceadams.core.Stoppable
- Overrides:
stopExecution
in classAbstractRatInput
-
-