Class MEMORYInterface
java.lang.Object
net.simplace.sim.io.interfaces.FWSimInterface<FWSimResultCache>
net.simplace.sim.io.interfaces.MEMORYInterface
Interface for outputs kept in memory, the fastest way for output that does not have to be written to a file
(e.g. for charts or the wrapper). The data is stored by the
CacheOutputAdapter in its result caches; this
interface only marks the output type. Reading is not supported.- Author:
- Andreas Enders
-
Nested Class Summary
Nested classes/interfaces inherited from class FWSimInterface
FWSimInterface.INTERFACE_TYPE -
Field Summary
Fields inherited from class FWSimInterface
iColumnMap, iColumnNamesInt, iIntColumnNames -
Constructor Summary
ConstructorsConstructorDescriptionMEMORYInterface(String aName, int aPoolSize) Creates the interface without element.MEMORYInterface(String aName, org.jdom2.Element aInterfaceElement) Creates the interface from its element. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Discards the result cache reference.getInterface(FWSimVarMap aVarMap, FWSimVariable.CONTENT_TYPE aContentType) Returns the access object of the interface, e.g.read(FWSimSession aFwSimSession, String aProjectID, Object aCache, LinkedHashMap<String, String> aKeyMap, FWSimInputAdapter aResourceAdapter, String aUniqueID, FWSimInterface.INTERFACE_TYPE aInterfaceType) Not supported; memory interfaces are only used for output.org.jdom2.ElementtoXML()Creates theinterfaceelement with id, type and pool size; subclasses add their settings.Methods inherited from class FWSimInterface
checkHeaderForColMode, createInterface, createInterface, createStatisticInterface, getInterfaceElement, getInterfaceType, getName, getPoolSize, readColArray, readColArray, toString, transformArrays, writeToDatabase
-
Constructor Details
-
MEMORYInterface
Creates the interface without element.- Parameters:
aName- name of the interfaceaPoolSize- pool size (not used)
-
MEMORYInterface
Creates the interface from its element.- Parameters:
aName- name of the interfaceaInterfaceElement- theinterfaceelement
-
-
Method Details
-
getInterface
Description copied from class:FWSimInterfaceReturns the access object of the interface, e.g. a database connection or a file pool.- Specified by:
getInterfacein classFWSimInterface<FWSimResultCache>- Parameters:
aVarMap- variable map used for replacing tokens (e.g. in file names), may benullaContentType-resfor reading,outfor writing- Returns:
- always
null: the data are kept by theCacheOutputAdapter(callers like the "Output is written to" log skipnull) - See Also:
-
toXML
public org.jdom2.Element toXML()Description copied from class:FWSimInterfaceCreates theinterfaceelement with id, type and pool size; subclasses add their settings.- Overrides:
toXMLin classFWSimInterface<FWSimResultCache>- Returns:
- the
interfaceelement with id, type and pool size
-
finalize
Discards the result cache reference.- Specified by:
finalizein classFWSimInterface<FWSimResultCache>- Throws:
Exception- if releasing fails- See Also:
-
read
public FWSimResourceCache read(FWSimSession aFwSimSession, String aProjectID, Object aCache, LinkedHashMap<String, String> aKeyMap, FWSimInputAdapter aResourceAdapter, String aUniqueID, FWSimInterface.INTERFACE_TYPE aInterfaceType) throws MissingSimResourceExceptionNot supported; memory interfaces are only used for output.- Specified by:
readin classFWSimInterface<FWSimResultCache>- Parameters:
aFwSimSession- the sessionaProjectID- id of the current projectaCache- the data read, in the format of the interface (e.g.String[][], result set, XML element)aKeyMap- key variables of the resourceaResourceAdapter- the adapter the cache belongs toaUniqueID- unique id of the source dataaInterfaceType- type of the source interface- Returns:
- always
null - Throws:
MissingSimResourceException- if the data cannot be converted- See Also:
-