|
JACK 5.4 Application Interface | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectaos.jack.jak.logic.Unifiable
aos.jack.jak.logic.Variable
This is the superclass of all objects generated by the JACK compiler
to represent variables declared as type "logical". It provides
different methods to access the value of the variable depending
on the specific variable type. For example, as_int()
,
as_string()
, etc.
Attempting to access the value of a variable using an accessor of the wrong type will have undefined results.
As of JACK version 5.2, the preferred way to access a logical
variable's value is to use the getValue()
method
provided by the derived class.
Constructor Summary | |
protected |
Variable(LogicEnv e,
java.lang.Class t,
boolean b)
|
Method Summary | |
boolean |
as_boolean()
Return the value of this variable as a boolean. |
byte |
as_byte()
Return the value of this variable as a byte. |
char |
as_char()
Return the value of this variable as a char. |
double |
as_double()
Return the value of this variable as a double. |
float |
as_float()
Return the value of this variable as a float. |
int |
as_int()
Return the value of this variable as a int. |
long |
as_long()
Return the value of this variable as a long. |
java.lang.Object |
as_object()
Return the value of this variable as a Object. |
short |
as_short()
Return the value of this variable as a short. |
java.lang.String |
as_string()
Return the value of this variable as a String. |
LogicEnv |
getEnv()
Return the logic environment in which this variable resides. |
java.lang.Class |
getType()
The type of entity this represents (for example, java.lang.Long). |
Unifiable |
getValueOf(LogicEnv e)
Return the value of this variable in the given logical environment. |
boolean |
isBound()
Returns whether the variable is currently bound. |
boolean |
isGround()
Returns whether the variable is currently grounded. |
java.lang.String |
toString()
Return the value of this variable as a String. |
protected void |
unbind()
|
boolean |
unify(boolean v)
|
boolean |
unify(byte v)
|
boolean |
unify(char v)
|
boolean |
unify(double v)
|
boolean |
unify(float v)
|
boolean |
unify(int v)
|
boolean |
unify(long v)
|
boolean |
unify(java.lang.Object v)
|
boolean |
unify(short v)
|
boolean |
unify(Unifiable v)
Unify this variable with anything implementing the Unifiable interface. |
boolean |
unify(Variable v)
Unify this variable with another variable. |
void |
untrail()
|
static java.lang.String |
variableType(java.lang.String key)
|
Methods inherited from class aos.jack.jak.logic.Unifiable |
as_unifiable, logicException |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Variable(LogicEnv e, java.lang.Class t, boolean b)
Method Detail |
public static java.lang.String variableType(java.lang.String key)
public LogicEnv getEnv()
protected void unbind()
public void untrail()
public boolean isBound()
public boolean isGround()
public java.lang.Class getType()
Unifiable
getType
in class Unifiable
public boolean unify(Variable v)
unify
in class Unifiable
public boolean unify(Unifiable v)
Unifiable
interface.
If this variable is currently bound, then the bound value
is attempted to be unified with the given
Unifiable
.
unify
in class Unifiable
public boolean unify(boolean v)
unify
in class Unifiable
public boolean unify(byte v)
unify
in class Unifiable
public boolean unify(char v)
unify
in class Unifiable
public boolean unify(short v)
unify
in class Unifiable
public boolean unify(int v)
unify
in class Unifiable
public boolean unify(long v)
unify
in class Unifiable
public boolean unify(float v)
unify
in class Unifiable
public boolean unify(double v)
unify
in class Unifiable
public boolean unify(java.lang.Object v)
unify
in class Unifiable
public boolean as_boolean()
as_boolean
in class Unifiable
public char as_char()
as_char
in class Unifiable
public byte as_byte()
as_byte
in class Unifiable
public short as_short()
as_short
in class Unifiable
public int as_int()
as_int
in class Unifiable
public long as_long()
as_long
in class Unifiable
public float as_float()
as_float
in class Unifiable
public double as_double()
as_double
in class Unifiable
public java.lang.Object as_object()
as_object
in class Unifiable
public java.lang.String toString()
public java.lang.String as_string()
as_string
in class Unifiable
public Unifiable getValueOf(LogicEnv e)
|
JACK 5.4 Application Interface | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.