Class NeqSimXtream
java.lang.Object
neqsim.util.serialization.NeqSimXtream
NeqSimXtream class for serializing and deserializing NeqSim objects.
Provides compressed XML serialization using XStream with ZIP compression. The resulting .neqsim files are compact and portable.
Features:
- Automatic ThreadLocal field exclusion
- ZIP compression for compact storage
- Full object graph preservation with ID references
- Version:
- 1.0
- Author:
- esol
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.LoggerLogger for this class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.thoughtworks.xstream.XStreamstatic ObjectopenNeqsim(String filename) Opens and deserializes an object from a compressed .neqsim file.static booleansaveNeqsim(Object javaobject, String filename) Saves an object to a compressed .neqsim file.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger for this class.
-
-
Constructor Details
-
NeqSimXtream
public NeqSimXtream()
-
-
Method Details
-
openNeqsim
Opens and deserializes an object from a compressed .neqsim file.- Parameters:
filename- the path to the .neqsim file- Returns:
- the deserialized object
- Throws:
IOException- if the file cannot be read or is not a valid .neqsim fileFileNotFoundException- if the file does not exist or process.xml is not found in ZIP
-
saveNeqsim
Saves an object to a compressed .neqsim file.The object is serialized to XML using XStream and compressed using ZIP compression.
- Parameters:
javaobject- the object to serialize (typically ProcessSystem or ProcessModel)filename- the path to save to (recommended extension: .neqsim)- Returns:
- true if save was successful, false otherwise
-
createConfiguredXStream
private static com.thoughtworks.xstream.XStream createConfiguredXStream()
-