public class Lifo
extends java.lang.Object
A Lifo object in Java can encapsulate a native lifo stack used to manage CLE-2000 parameters.
A lifo stack can contain defined or undefined (empty) nodes; used to represent known or unknown parameters, respectively.
Note: There is a constraint in CLE-2000. LCM (or XSM) objects and files must be pushed before single-value nodes in the stack.
Author: Alain Hebert, Ecole Polytechnique de Montreal (2010)
Constructor and Description |
---|
Lifo()
Use this constructor to create an empty Lifo object.
|
Modifier and Type | Method and Description |
---|---|
int |
getMax()
Gives the number of nodes in the lifo stack
|
void |
lib()
Print the table-of-content of a lifo stack
|
java.lang.Object |
node(int ipos)
Return the node at a given position or null.
|
java.lang.Object |
node(java.lang.String sname)
Return the node with a given name or null.
|
java.lang.String |
OSName(int ipos)
Return the OSname of the node at a given position.
|
java.lang.String |
OSName(java.lang.String sname)
Return the OSname of the node associated with a given name.
|
java.lang.Object |
pop()
Pop the node on top of the Lifo stack.
|
void |
push(java.lang.String sname,
boolean my_boolean)
Push a new boolean on top of the Lifo stack
|
void |
push(java.lang.String sname,
double my_double)
Push a new double on top of the Lifo stack
|
void |
push(java.lang.String sname,
float my_float)
Push a new float on top of the Lifo stack
|
void |
push(java.lang.String sname,
int my_integer)
Push a new integer on top of the Lifo stack
|
void |
push(java.lang.String sname,
java.lang.Object node)
Push a new node object on top of the Lifo stack
|
void |
push(java.lang.String sname,
java.lang.Object node,
java.lang.String stype)
Push a new node object with a type on top of the Lifo stack
|
void |
push(java.lang.String sname,
java.lang.Object node,
java.lang.String stype,
java.lang.String OSname)
Push a new node object with a type and an "OSname" on top of the Lifo stack
|
int |
typeNode(int ipos)
Return the type of the node at a given position.
|
int |
typeNode(java.lang.String sname)
Return the type of the node associated with a given name.
|
public java.lang.Object pop()
public java.lang.Object node(java.lang.String sname)
sname
- node name (limited to 12 characters)public java.lang.Object node(int ipos)
ipos
- node position in lifo stackpublic java.lang.String OSName(java.lang.String sname)
sname
- node name (limited to 12 characters)public java.lang.String OSName(int ipos)
ipos
- node position in lifo stackpublic int typeNode(java.lang.String sname)
sname
- node name (limited to 12 characters)public int typeNode(int ipos)
ipos
- node position in lifo stackpublic void push(java.lang.String sname, java.lang.Object node)
sname
- node name (limited to 12 characters)node
- node object to push into the lifo stack. If "node" is a
class, an empty node is pushed in the lifo stack in order to receive a calculation
resultpublic void push(java.lang.String sname, java.lang.Object node, java.lang.String stype)
sname
- node name (limited to 12 characters)node
- node object to push into the lifo stack. If "node" is a
class, an empty node is pushed in the lifo stack in order to receive a calculation
resultstype
- type of LCM object or file. This variable is chosen among
the following values:
public void push(java.lang.String sname, java.lang.Object node, java.lang.String stype, java.lang.String OSname)
sname
- node name (limited to 12 characters)node
- node object to push into the lifo stack. If "node" is a class,
an empty node is pushed in the lifo stack in order to receive a calculation resultstype
- type of LCM object or file. This variable is chosen among
the following values:
OSname
- operating system (OS) name associated to the node (limited to 72 characters).
Can be given only for LCM (or XSM) objects or files.public void push(java.lang.String sname, int my_integer)
sname
- node name (limited to 12 characters)my_integer
- integer value to push into the lifo stackpublic void push(java.lang.String sname, float my_float)
sname
- node name (limited to 12 characters)my_float
- float value to push into the lifo stackpublic void push(java.lang.String sname, double my_double)
sname
- node name (limited to 12 characters)my_double
- double value to push into the lifo stackpublic void push(java.lang.String sname, boolean my_boolean)
sname
- node name (limited to 12 characters)my_boolean
- boolean value to push into the lifo stackpublic int getMax()
public void lib()