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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected FWSimIOAdapter.FREQUENCEprotected LinkedHashMap<String,FWSimVariable<?>> protected Stringprotected int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFWSimCache(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 TypeMethodDescriptionvoidaddVariable(FWSimVariable<?> aVariable) use this method with care - data has to be synchronized with the HeaderVariablesvoidcheckCondition(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.getCache()inttaken from the HeaderVariablesreturned list will always be empty!getName()intdelivers a list from the header informationgetVariable(String aID) getVariableIndex(String aFieldName) booleanbooleanvoidremoveVariable(String aID) use this method with care - data has to be synchronized with the HeaderVariablesvoidsetCacheMap(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, waitMethods 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:
getNamein interfaceFWSimFieldContainer- Returns:
- the name
-
getFieldcount
public int getFieldcount()- Returns:
- the fieldcount
-
isArrayMode
public boolean isArrayMode()- Returns:
- the arrayMode
-
createVariables
- Specified by:
createVariablesin 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:
addVariablein interfaceFWSimFieldContainer- See Also:
-
getVariable
- Specified by:
getVariablein 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:
removeVariablein interfaceFWSimFieldContainer- See Also:
-
getOutputVariables
delivers a list from the header information- Specified by:
getOutputVariablesin interfaceFWSimFieldContainer- Returns:
- FWSimVarables filtered - only output Variables
- See Also:
-
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumberin interfaceFWSimFieldContainer- Returns:
- number in the order of Components
- See Also:
-
getInputVariables
returned list will always be empty! Resources have not input fields- Specified by:
getInputVariablesin interfaceFWSimFieldContainer- Returns:
- FWSimVarables filtered - only input Variables
- See Also:
-
getFieldMap
taken from the HeaderVariables- Specified by:
getFieldMapin interfaceFWSimFieldContainer- Returns:
- whole field map as created in createVariables()
- See Also:
-
setCacheMap
setting complete new data structure- Parameters:
aNewFieldMap-
-
getContentType
- Specified by:
getContentTypein interfaceFWSimFieldContainer- Returns:
- number in the order of Components
- See Also:
-
getFrequence
- Specified by:
getFrequencein interfaceFWSimFieldContainer- Returns:
- the Frequence of the Container calling
- See Also:
-
getVariableIndex
- Parameters:
aFieldName-- Returns:
- the variable index
-
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
-