|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjecthSimulator.library.Model
public class Model
This object implements a reaction model.
Field Summary | |
---|---|
double |
numMoleculesInAMole
Number of variable molecules in a mole (Avogadro's number). |
static String |
variableCompartmentSeparator
Variable - Compartment separator used to identify variable IDs. |
Constructor Summary | |
---|---|
Model(String spec)
Constructs a new model according to the provided textual specification. |
Method Summary | |
---|---|
Model |
clone()
Clones the model. |
static Model |
createFromFile(String fileName)
Creates a new model according to the textual specification stored in a file. |
List<String> |
getVariables()
Returns the list of variable IDs of the model. |
static Model |
loadModel(String filePath)
Loads a model from file. |
static void |
saveModel(Model m,
String filePath)
Saves a model to file. |
String |
toString()
Returns the textual specification of the model provided by the user. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String variableCompartmentSeparator
public double numMoleculesInAMole
Constructor Detail |
---|
public Model(String spec) throws ParseException
spec
- textual specification of the model
ParseException
- if an error occurred during the parsing of the textual specification of the modelMethod Detail |
---|
public String toString()
toString
in class Object
public List<String> getVariables()
variableName + variableCompartmentSeparator + compartmentName
.
public Model clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public static void saveModel(Model m, String filePath) throws FileNotFoundException, IOException
m
- the Model
object which needs to be savedfilePath
- path pointing out the resource where the model needs to be saved
FileNotFoundException
- if the file specified in filePath
exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
IOException
- if an input/output error occurred while writing the objectpublic static Model loadModel(String filePath) throws FileNotFoundException, IOException, ClassNotFoundException
filePath
- path pointing out the resource where the model is saved
Model
object
FileNotFoundException
- if the file specified in filePath
exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
IOException
- if an input/output error occurred while reading the object
ClassNotFoundException
- if the object saved in filePath
is not a Model
objectpublic static Model createFromFile(String fileName) throws FileNotFoundException, IOException, ParseException
fileName
- file storing the model specification
FileNotFoundException
- if the specified file does not exist
IOException
- if an input/output error occurred during the reading (from file) of the textual specification of the model
ParseException
- if an error occurred during the parsing of the textual specification of the model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |