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 FWSimResourceTransformer
s 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
ConstructorDescriptionFWSimResourceCache
(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 TypeMethodDescriptionvoid
addVariable
(FWSimVariable<?> aVariable) use this method with care - data has to be synchronized with the HeaderVariablesvoid
fillVarMapFromCache
(FWSimVarMap aSimVarMap) default method to get data out of this resource: Fill invoid
fillVarMapFromCache
(FWSimVarMap aSimVarMap, FWSimInputAdapter aInputAdapter) default method to get data out of this resource: Fill inorg.jdom2.Element
org.jdom2.Element
getEditFormXML
(boolean aEnabled) returned list will always be empty!delivers a list from the header informationgetVariable
(String aID) boolean
void
removeVariable
(String aID) use this method with care - data has to be synchronized with the HeaderVariablesvoid
setInterfaceType
(FWSimInterface.INTERFACE_TYPE aInterfaceType) boolean
shouldUpdate
(FWSimVarMap aVarMap) boolean
shouldUpdate
(FWSimVarMap aVarMap, FWSimInputAdapter aInputAdapter) splitCache
(LinkedHashMap<String, String> aKeyMap) toString()
org.jdom2.Element
toXML()
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:
addVariable
in interfaceFWSimFieldContainer
- Overrides:
addVariable
in classFWSimCache
- See Also:
-
getVariable
- Specified by:
getVariable
in interfaceFWSimFieldContainer
- Overrides:
getVariable
in 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:
removeVariable
in interfaceFWSimFieldContainer
- Overrides:
removeVariable
in classFWSimCache
- See Also:
-
getOutputVariables
delivers a list from the header information- Specified by:
getOutputVariables
in interfaceFWSimFieldContainer
- Overrides:
getOutputVariables
in classFWSimCache
- Returns:
- FWSimVarables filtered - only output Variables
- See Also:
-
getInputVariables
returned list will always be empty! Resources have not input fields- Specified by:
getInputVariables
in interfaceFWSimFieldContainer
- Overrides:
getInputVariables
in classFWSimCache
- Returns:
- FWSimVarables filtered - only input Variables
- See Also:
-
getContentType
- Specified by:
getContentType
in interfaceFWSimFieldContainer
- Overrides:
getContentType
in 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
-