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
Nested ClassesModifier and TypeClassDescriptionstatic enumFREQUENCE the data is written, accessed, used or updated in the different adapters -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanSource field from SimVarMap where key is taken from to filter the data in the adapterprotected intNumber count of the fields accessible in this adapterprotected final FWSimIOAdapter.FREQUENCEFREQUENCE 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 Stringprotected LinkedHashMap<String,String> Key field of data in the adapterprotected final StringName from configurationprotected intorder number for the serial order of the componentsprotected ProcessTimeprotected final org.jdom2.Elementsource Element used for creation of the Adapterprotected final FWSimSessionprotected StringSource field from SimVarMap where key is taken from to filter the data in the adapter -
Constructor Summary
ConstructorsModifierConstructorDescriptionFWSimIOAdapter(FWSimIOAdapter aAdapter, FWSimInterface<?> aInterface) FWSimIOAdapter(org.jdom2.Element aResourceElement, String aName, int aOrderNumber, FWSimInterface<?> aInterface, FWSimIOAdapter.FREQUENCE aFrequence, ProcessTime aProcessTime, FWSimSession aSession) protectedFWSimIOAdapter(org.jdom2.Element aResourceElement, FWSimSession aSession, int aOrderNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessTime(long aProcessTime) adds the processTimevoidaddVariable(FWSimVariable<?> aVariable) be careful if using this method while it adds a field to the header informationvoidcheckCondition(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.static org.jdom2.ElementcreateFormFields(FWSimVariable.CONTENT_TYPE aContentType, FWSimInterface<?> aInterface, FWSimIOAdapter aAdapter, FWSimIOAdapter.FREQUENCE aFrequence, boolean aEnabled) returns a new hash map containing the header informationvoidfinalize()org.jdom2.Elementorg.jdom2.ElementgetEditFormXML(boolean aEnabled) returns the header informationorg.jdom2.ElementgetName()intgetVariable(String aID) gets FWSimVariable from the header informationbooleanbooleanvoidremoveVariable(String aID) be careful if using this method while it removes a field from the header informationvoidsetInterface(FWSimInterface<?> aInterface) voidsetOrderNumber(int orderNumber) toString()implementation returning the name of the component onlyprotected voidwrites a new header list to the elementMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
addVariablein interfaceFWSimFieldContainer- See Also:
-
getVariable
gets FWSimVariable from the header information- Specified by:
getVariablein 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:
removeVariablein interfaceFWSimFieldContainer- See Also:
-
getName
- Specified by:
getNamein interfaceFWSimFieldContainer- Returns:
- the name
-
getFrequence
- Specified by:
getFrequencein interfaceFWSimFieldContainer- Returns:
- the frequency
-
getJexlRule
- Returns:
- the rule
-
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumberin 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:
createVariablesin 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:
getFieldMapin 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:
getCreateFormXMLin interfaceFWSimFieldContainer- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Specified by:
getEditFormXMLin 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:FWSimFieldContainerCalled from inside the FWSimFieldContainer to log the initialization Errors.- Specified by:
checkConditionin interfaceFWSimFieldContainer
-
isConditionCheck
public boolean isConditionCheck()- Specified by:
isConditionCheckin interfaceFWSimFieldContainer
-