Package net.simplace.sim.io
Class FWSimIOAdapter
java.lang.Object
net.simplace.sim.io.FWSimIOAdapter
- All Implemented Interfaces:
FWSimFieldContainer
- Direct Known Subclasses:
FWSimInputAdapter
,FWSimOutputAdapter
,FWSimSyncAdapter
Implements the
FWSimFieldContainer
to be able to access resources and output
adaptors extending this class.
create form fields makes it possible to use the form fields to fill the content of this adapter.- Author:
- Andreas Enders
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
FREQUENCE the data is written, accessed, used or updated in the different adapters -
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Source field from SimVarMap where key is taken from to filter the data in the adapterprotected int
Number count of the fields accessible in this adapterprotected final FWSimIOAdapter.FREQUENCE
FREQUENCE the data is written, accessed, used or updated in the different adaptersprotected final LinkedHashMap<String,
FWSimVariable<?>> Hash map of the HeaderVariables used for all data interfacing.protected FWSimInterface<?>
SimInterface used to access the data.protected String
protected LinkedHashMap<String,
String> Key field of data in the adapterprotected final String
Name from configurationprotected int
order number for the serial order of the componentsprotected ProcessTime
protected final org.jdom2.Element
source Element used for creation of the Adapterprotected final FWSimSession
protected String
Source field from SimVarMap where key is taken from to filter the data in the adapter -
Constructor Summary
ModifierConstructorDescriptionFWSimIOAdapter
(FWSimIOAdapter aAdapter, FWSimInterface<?> aInterface) FWSimIOAdapter
(org.jdom2.Element aResourceElement, String aName, int aOrderNumber, FWSimInterface<?> aInterface, FWSimIOAdapter.FREQUENCE aFrequence, ProcessTime aProcessTime, FWSimSession aSession) protected
FWSimIOAdapter
(org.jdom2.Element aResourceElement, FWSimSession aSession, int aOrderNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProcessTime
(long aProcessTime) adds the processTimevoid
addVariable
(FWSimVariable<?> aVariable) be careful if using this method while it adds a field to the header informationvoid
checkCondition
(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.static org.jdom2.Element
createFormFields
(FWSimVariable.CONTENT_TYPE aContentType, FWSimInterface<?> aInterface, FWSimIOAdapter aAdapter, FWSimIOAdapter.FREQUENCE aFrequence, boolean aEnabled) returns a new hash map containing the header informationvoid
finalize()
org.jdom2.Element
org.jdom2.Element
getEditFormXML
(boolean aEnabled) returns the header informationorg.jdom2.Element
getName()
int
getVariable
(String aID) gets FWSimVariable from the header informationboolean
boolean
void
removeVariable
(String aID) be careful if using this method while it removes a field from the header informationvoid
setInterface
(FWSimInterface<?> aInterface) void
setOrderNumber
(int orderNumber) toString()
implementation returning the name of the component onlyprotected void
writes a new header list to the elementMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.simplace.sim.util.FWSimFieldContainer
getContentType, getInputVariables, getOutputVariables, getVarMap, toXML
-
Field Details
-
iJexlRule
-
iSession
-
iResourceElement
protected final org.jdom2.Element iResourceElementsource Element used for creation of the Adapter -
iName
Name from configuration -
iOrderNumber
protected int iOrderNumberorder number for the serial order of the components -
iInterface
SimInterface used to access the data. Adapter stays media independent. -
iHeaderVariables
Hash map of the HeaderVariables used for all data interfacing. Used for Input - Resources and Output - Results -
iFieldcount
protected int iFieldcountNumber count of the fields accessible in this adapter -
iFrequence
FREQUENCE the data is written, accessed, used or updated in the different adapters -
iKeyMap
Key field of data in the adapter -
iSourceKey
Source field from SimVarMap where key is taken from to filter the data in the adapter -
iArrayMode
protected boolean iArrayModeSource field from SimVarMap where key is taken from to filter the data in the adapter -
iProcessTime
-
-
Constructor Details
-
FWSimIOAdapter
protected FWSimIOAdapter(org.jdom2.Element aResourceElement, FWSimSession aSession, int aOrderNumber) - Parameters:
aResourceElement
-aSession
-aOrderNumber
-
-
FWSimIOAdapter
public FWSimIOAdapter(org.jdom2.Element aResourceElement, String aName, int aOrderNumber, FWSimInterface<?> aInterface, FWSimIOAdapter.FREQUENCE aFrequence, ProcessTime aProcessTime, FWSimSession aSession) - Parameters:
aResourceElement
-aName
-aOrderNumber
-aInterface
-aFrequence
-aProcessTime
-aSession
-
-
FWSimIOAdapter
- Parameters:
aAdapter
-aInterface
-
-
-
Method Details
-
addVariable
be careful if using this method while it adds a field to the header information- Specified by:
addVariable
in interfaceFWSimFieldContainer
- See Also:
-
getVariable
gets FWSimVariable from the header information- Specified by:
getVariable
in interfaceFWSimFieldContainer
- Returns:
- FWSimVariable for ID in Field Map
- See Also:
-
removeVariable
be careful if using this method while it removes a field from the header information- Specified by:
removeVariable
in interfaceFWSimFieldContainer
- See Also:
-
getName
- Specified by:
getName
in interfaceFWSimFieldContainer
- Returns:
- the name
-
getFrequence
- Specified by:
getFrequence
in interfaceFWSimFieldContainer
- Returns:
- the frequency
-
getJexlRule
- Returns:
- the rule
-
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumber
in interfaceFWSimFieldContainer
- Returns:
- the orderNumber
-
setOrderNumber
public void setOrderNumber(int orderNumber) - Parameters:
orderNumber
- the orderNumber to set
-
getInterface
- Returns:
- FWSimInterface
-
setInterface
- Parameters:
aInterface
-
-
getKeyMap
- Returns:
- the key
-
getHeaderVariables
- Returns:
- the headerVariables
-
createVariables
returns a new hash map containing the header information- Specified by:
createVariables
in interfaceFWSimFieldContainer
- Returns:
- variables from the field map
- See Also:
-
addProcessTime
public void addProcessTime(long aProcessTime) adds the processTime- Parameters:
aProcessTime
-
-
getFieldMap
returns the header information- Specified by:
getFieldMap
in interfaceFWSimFieldContainer
- Returns:
- whole field map as created in createVariables()
- See Also:
-
toString
implementation returning the name of the component only -
getHeaderXML
public org.jdom2.Element getHeaderXML()- Returns:
- XML Element of the Header information
-
isArrayMode
public boolean isArrayMode()- Returns:
- if the Adapter is used in ArrayMode
-
getCreateFormXML
public org.jdom2.Element getCreateFormXML()- Specified by:
getCreateFormXML
in interfaceFWSimFieldContainer
- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Specified by:
getEditFormXML
in interfaceFWSimFieldContainer
- Returns:
- a xml element with all the settings of this component()
- See Also:
-
createFormFields
public static org.jdom2.Element createFormFields(FWSimVariable.CONTENT_TYPE aContentType, FWSimInterface<?> aInterface, FWSimIOAdapter aAdapter, FWSimIOAdapter.FREQUENCE aFrequence, boolean aEnabled) - Parameters:
aContentType
-aInterface
-aAdapter
-aFrequence
-aEnabled
-- Returns:
- the created Element
-
writeHeaderList
protected void writeHeaderList()writes a new header list to the element -
finalize
-
checkCondition
Description copied from interface:FWSimFieldContainer
Called from inside the FWSimFieldContainer to log the initialization Errors.- Specified by:
checkCondition
in interfaceFWSimFieldContainer
-
isConditionCheck
public boolean isConditionCheck()- Specified by:
isConditionCheck
in interfaceFWSimFieldContainer
-