net.simplace.sim.io.resources.FWSimResourceCache

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 net.simplace.sim.transformers.DefaultSQLStatementTransformer. Cache is used by FWSimResourceTransformers and FWSimResourceAdapter.


public class FWSimResourceCache extends net.simplace.sim.io.FWSimCache {
// Public Constructors
public FWSimResourceCache(FWSimSession aFwSimSession, LinkedHashMap aKeyMap,
FWSimInputAdapter aResourceAdapter, String aUniqueID,
FWSimInterface.INTERFACE_TYPE aInterfaceType);


// Class Methods
public static FWSimResourceCache fromResultSet(FWSimSession aFwSimSession,
String aProjectID, ResultSet aResultSet, LinkedHashMap aKeyMap,
FWSimInputAdapter aResourceAdapter, String aUniqueID,
FWSimInterface.INTERFACE_TYPE aInterfaceType);

factory method for data out of databases
returns the new created FWSimResourceCache
public static FWSimResourceCache fromCSV(FWSimSession aFwSimSession, String
aProjectID, String[][] aCache, LinkedHashMap aKeyMap,
FWSimResourceAdapter aResourceAdapter, String aUniqueID,
FWSimInterface.INTERFACE_TYPE aInterfaceType)
throws MissingSimResourceException;

factory method for data out of excel sheets
returns the new created FWSimResourceCache
public static FWSimResourceCache fromXML(FWSimSession aFwSimSession, String
aProjectID, Element aConfiguration, String aXPath, LinkedHashMap aKeyMap,
FWSimResourceAdapter aResourceAdapter, String aUniqueID,
FWSimInterface.INTERFACE_TYPE aInterfaceType);

factory method for data out of xml files
returns the new created FWSimResourceCache
public static FWSimResourceCache fromNetCDFCache(FWSimSession
aCurrentSession, String aProjectID, Object[][] aFileCache, LinkedHashMap
aKeyMap, NetCDFResourceAdapter aNetCDFResourceAdapter, String aUniqueID,
FWSimInterface.INTERFACE_TYPE aNetcdf)
throws MissingSimResourceException;


returns

// Public Instance Methods
public void fillVarMapFromCache(FWSimVarMap aSimVarMap);

default method to get data out of this resource: Fill in
# public void fillVarMapFromDatabase(FWSimVarMap aSimVarMap, Connection
aConnection) throws SimFieldMissingException;

public void addVariable(FWSimVariable aVariable); // Defines
net.simplace.sim.io.FWSimCache


use this method with care - data has to be synchronized with the HeaderVariables
public FWSimVariable getVariable(String aID); // Defines
net.simplace.sim.io.FWSimCache


public void removeVariable(String aID); // Defines
net.simplace.sim.io.FWSimCache


use this method with care - data has to be synchronized with the HeaderVariables
public Collection getOutputVariables(); // Defines
net.simplace.sim.io.FWSimCache


delivers a list from the header information
public Collection getInputVariables(); // Defines
net.simplace.sim.io.FWSimCache


returned list will always be empty! Resources have not input fields
public FWSimVariable.CONTENT_TYPE getContentType(); // Defines
net.simplace.sim.io.FWSimCache


public LinkedHashMap getKeyMap();


returns the key map of this Resource
public boolean shouldUpdate(FWSimVarMap aVarMap);


returns boolean if the rule is true or false
public Element toXML();

public Element getCreateFormXML();

public Element getEditFormXML(boolean aEnabled);

public FWSimSession getCurrentSession();


returns current {@link FWSimSession}
public String toString(); // Overrides java.lang.Object

public String getUniqueID();

public boolean isFromTransformer();


returns
public FWSimInputAdapter getResourceAdapter();


returns
public LinkedList splitCache(LinkedHashMap aKeyMap);


returns a list of splitted cache maps
public FWSimVarMap getVarMap();

public FWSimInterface.INTERFACE_TYPE getInterfaceType();


returns the interfaceType
public void setInterfaceType(FWSimInterface.INTERFACE_TYPE aInterfaceType);



}



Hierarchy: java.lang.Object - net.simplace.sim.io.FWSimCache (net.simplace.sim.util.FWSimFieldContainer) - FWSimResourceCache



Extended by: NetCDFResourceCache



Returned by: fromCSV(), fromNetCDFCache(), fromResultSet(), fromXML(), FWSimInputAdapter.getData(), net.simplace.sim.io.resources.adapter.XMLResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.NetCDFResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.DatabaseResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.CSVResourceAdapter.getData(), net.simplace.sim.transformers.DefaultSQLStatementTransformer.getData(), net.simplace.sim.transformers.DefaultRuleTransformer.getData(), net.simplace.sim.io.resources.adapter.XMLResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.NetCDFResourceAdapter.getData(), net.simplace.sim.io.resources.adapter.CSVResourceAdapter.getData(), FWSimResourceManager.getResourceCache(), FWSimResourceTransformer.getSourceResourceCache()