Package net.simplace.sim.io
Class FWSimCache
java.lang.Object
net.simplace.sim.io.FWSimCache
- All Implemented Interfaces:
FWSimFieldContainer
- Direct Known Subclasses:
FWSimResourceCache
,FWSimResultCache
,FWSimulationControlCache
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.
See the 2 extending classes:
FWSimResourceCache
and FWSimResultCache
.- Author:
- Andreas Enders
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected int
protected FWSimIOAdapter.FREQUENCE
protected LinkedHashMap<String,
FWSimVariable<?>> protected String
protected int
-
Constructor Summary
ModifierConstructorDescriptionprotected
FWSimCache
(int aFieldcount, String aName, HashMap<Object, Object[]> aCache, boolean aArrayMode, LinkedHashMap<String, FWSimVariable<?>> aHeaderVariables, FWSimIOAdapter.FREQUENCE aFrequence, int aOrderNumber, HashMap<String, Integer> aVariableIndex) FWSimCache
(LinkedHashMap<String, FWSimVariable<?>> aHeaderVariables, FWSimIOAdapter.FREQUENCE aFrequence, String aName, int aOrderNumber) 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
checkCondition
(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.getCache()
int
taken from the HeaderVariablesreturned list will always be empty!getName()
int
delivers a list from the header informationgetVariable
(String aID) getVariableIndex
(String aFieldName) boolean
boolean
void
removeVariable
(String aID) use this method with care - data has to be synchronized with the HeaderVariablesvoid
setCacheMap
(HashMap<Object, Object[]> aNewFieldMap) setting complete new data structureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.simplace.sim.util.FWSimFieldContainer
getCreateFormXML, getEditFormXML, getVarMap, toXML
-
Field Details
-
iFieldcount
protected int iFieldcount -
iName
-
iCache
-
iArrayMode
protected boolean iArrayMode -
iHeaderVariables
-
iVariablesIndexes
-
iFrequence
-
iOrderNumber
protected int iOrderNumber
-
-
Constructor Details
-
FWSimCache
public FWSimCache(LinkedHashMap<String, FWSimVariable<?>> aHeaderVariables, FWSimIOAdapter.FREQUENCE aFrequence, String aName, int aOrderNumber) constructor from different media types in the fitting structure also used by transformers- Parameters:
aHeaderVariables
-aFrequence
-aName
-aOrderNumber
-
-
FWSimCache
protected FWSimCache(int aFieldcount, String aName, HashMap<Object, Object[]> aCache, boolean aArrayMode, LinkedHashMap<String, FWSimVariable<?>> aHeaderVariables, FWSimIOAdapter.FREQUENCE aFrequence, int aOrderNumber, HashMap<String, Integer> aVariableIndex) - Parameters:
aFieldcount
-aName
-aCache
-aArrayMode
-aHeaderVariables
-aFrequence
-aOrderNumber
-aVariableIndex
-
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceFWSimFieldContainer
- Returns:
- the name
-
getFieldcount
public int getFieldcount()- Returns:
- the fieldcount
-
isArrayMode
public boolean isArrayMode()- Returns:
- the arrayMode
-
createVariables
- Specified by:
createVariables
in interfaceFWSimFieldContainer
- Returns:
- variables from the field map
- See Also:
-
getCache
- Returns:
- the whole data content within the object[]
-
addVariable
use this method with care - data has to be synchronized with the HeaderVariables- Specified by:
addVariable
in interfaceFWSimFieldContainer
- See Also:
-
getVariable
- Specified by:
getVariable
in interfaceFWSimFieldContainer
- Returns:
- FWSimVariable for ID in Field Map
- See Also:
-
getVariables
- Returns:
- the Header Variables
- See Also:
-
removeVariable
use this method with care - data has to be synchronized with the HeaderVariables- Specified by:
removeVariable
in interfaceFWSimFieldContainer
- See Also:
-
getOutputVariables
delivers a list from the header information- Specified by:
getOutputVariables
in interfaceFWSimFieldContainer
- Returns:
- FWSimVarables filtered - only output Variables
- See Also:
-
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumber
in interfaceFWSimFieldContainer
- Returns:
- number in the order of Components
- See Also:
-
getInputVariables
returned list will always be empty! Resources have not input fields- Specified by:
getInputVariables
in interfaceFWSimFieldContainer
- Returns:
- FWSimVarables filtered - only input Variables
- See Also:
-
getFieldMap
taken from the HeaderVariables- Specified by:
getFieldMap
in interfaceFWSimFieldContainer
- Returns:
- whole field map as created in createVariables()
- See Also:
-
setCacheMap
setting complete new data structure- Parameters:
aNewFieldMap
-
-
getContentType
- Specified by:
getContentType
in interfaceFWSimFieldContainer
- Returns:
- number in the order of Components
- See Also:
-
getFrequence
- Specified by:
getFrequence
in interfaceFWSimFieldContainer
- Returns:
- the Frequence of the Container calling
- See Also:
-
getVariableIndex
- Parameters:
aFieldName
-- Returns:
- the variable index
-
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
-