Package net.simplace.sim.io.resources
Class FWSimResourceCache
java.lang.Object
net.simplace.sim.io.FWSimCache
net.simplace.sim.io.resources.FWSimResourceCache
- All Implemented Interfaces:
FWSimFieldContainer
- Direct Known Subclasses:
NetCDFResourceCache
Out of performance reasons the data from resources is stored within the ResourceCache. Herein a
Object[] is used to make the data accessible very fast.
The class provides the feature of reading and caching the resources. A table in an internal
database is created to be able to use
DefaultSQLStatementTransformer.
Cache is used by FWSimResourceTransformers and FWSimResourceAdapter.- Author:
- Andreas Enders
-
Field Summary
Fields inherited from class net.simplace.sim.io.FWSimCache
iArrayMode, iCache, iFieldcount, iFrequence, iHeaderVariables, iName, iOrderNumber, iVariablesIndexes -
Constructor Summary
ConstructorsConstructorDescriptionFWSimResourceCache(FWSimSession aFwSimSession, LinkedHashMap<String, String> aKeyMap, FWSimInputAdapter aResourceAdapter, String aUniqueID, FWSimInterface.INTERFACE_TYPE aInterfaceType) constructor from different media types in the fitting structure also used by transformers -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariable(FWSimVariable<?> aVariable) use this method with care - data has to be synchronized with the HeaderVariablesvoidfillVarMapFromCache(FWSimVarMap aSimVarMap) default method to get data out of this resource: Fill invoidfillVarMapFromCache(FWSimVarMap aSimVarMap, FWSimInputAdapter aInputAdapter) default method to get data out of this resource: Fill inorg.jdom2.Elementorg.jdom2.ElementgetEditFormXML(boolean aEnabled) returned list will always be empty!delivers a list from the header informationgetVariable(String aID) booleanvoidremoveVariable(String aID) use this method with care - data has to be synchronized with the HeaderVariablesvoidsetInterfaceType(FWSimInterface.INTERFACE_TYPE aInterfaceType) booleanshouldUpdate(FWSimVarMap aVarMap) booleanshouldUpdate(FWSimVarMap aVarMap, FWSimInputAdapter aInputAdapter) splitCache(LinkedHashMap<String, String> aKeyMap) toString()org.jdom2.ElementtoXML()Methods inherited from class net.simplace.sim.io.FWSimCache
checkCondition, createVariables, getCache, getFieldcount, getFieldMap, getFrequence, getName, getOrderNumber, getVariableIndex, getVariables, isArrayMode, isConditionCheck, setCacheMap
-
Constructor Details
-
FWSimResourceCache
public FWSimResourceCache(FWSimSession aFwSimSession, LinkedHashMap<String, String> aKeyMap, FWSimInputAdapter aResourceAdapter, String aUniqueID, FWSimInterface.INTERFACE_TYPE aInterfaceType) constructor from different media types in the fitting structure also used by transformers- Parameters:
aFwSimSession-aKeyMap-aResourceAdapter-aUniqueID-aInterfaceType-
-
-
Method Details
-
fillVarMapFromCache
default method to get data out of this resource: Fill in- Parameters:
aSimVarMap-aResourceAdapter-
-
fillVarMapFromCache
default method to get data out of this resource: Fill in- Parameters:
aSimVarMap-aInputAdapter-
-
addVariable
use this method with care - data has to be synchronized with the HeaderVariables- Specified by:
addVariablein interfaceFWSimFieldContainer- Overrides:
addVariablein classFWSimCache- See Also:
-
getVariable
- Specified by:
getVariablein interfaceFWSimFieldContainer- Overrides:
getVariablein classFWSimCache- Returns:
- FWSimVariable for ID in Field Map
- See Also:
-
removeVariable
use this method with care - data has to be synchronized with the HeaderVariables- Specified by:
removeVariablein interfaceFWSimFieldContainer- Overrides:
removeVariablein classFWSimCache- See Also:
-
getOutputVariables
delivers a list from the header information- Specified by:
getOutputVariablesin interfaceFWSimFieldContainer- Overrides:
getOutputVariablesin classFWSimCache- Returns:
- FWSimVarables filtered - only output Variables
- See Also:
-
getInputVariables
returned list will always be empty! Resources have not input fields- Specified by:
getInputVariablesin interfaceFWSimFieldContainer- Overrides:
getInputVariablesin classFWSimCache- Returns:
- FWSimVarables filtered - only input Variables
- See Also:
-
getContentType
- Specified by:
getContentTypein interfaceFWSimFieldContainer- Overrides:
getContentTypein classFWSimCache- Returns:
- number in the order of Components
- See Also:
-
getKeyMap
- Returns:
- the key map of this Resource
-
shouldUpdate
- Parameters:
aVarMap-- Returns:
- boolean if the rule is true or false
-
shouldUpdate
- Parameters:
aVarMap-aInputAdapter-- Returns:
- boolean if the rule is true or false
-
toXML
public org.jdom2.Element toXML()- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getCreateFormXML
public org.jdom2.Element getCreateFormXML()- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Returns:
- a xml element with all the settings of this component()
- See Also:
-
getCurrentSession
- Returns:
- current
FWSimSession
-
toString
-
getUniqueID
-
isFromTransformer
public boolean isFromTransformer()- Returns:
-
getResourceAdapter
- Returns:
-
splitCache
- Parameters:
aKeyMap-- Returns:
- a list of splitted cache maps
-
getVarMap
- Returns:
- number in the order of Components
-
getInterfaceType
- Returns:
- the interfaceType
-
setInterfaceType
- Parameters:
aInterfaceType- the interfaceType to set
-