net.simplace.simulation.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.simulation.io.resources.transformer.DefaultSQLStatementTransformer. Cache is used by FWSimResourceTransformers and FWSimResourceAdapter.


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


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

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)
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);

factory method for data out of xml files
returns the new created FWSimResourceCache

// 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.simulation.io.FWSimCache


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


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


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


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


returned list will always be empty! Resources have not input fields
public FWSimVariable.CONTENT_TYPE getContentType(); // Defines
net.simplace.simulation.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();



}



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



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