|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunsw.cse.framescript.Term
unsw.cse.framescript.FSNumber
public abstract class FSNumber
This is the super class for all of the numerical types used is FrameScript.
Constructor Summary | |
---|---|
FSNumber()
|
Method Summary | |
---|---|
abstract FSNumber |
add(FSNumber n)
Adds two numbers. |
abstract FSNumber |
divide(FSNumber n)
Divides two numbers. |
abstract boolean |
eq(FSNumber n)
Compares two numbers for equality. |
boolean |
equals(Term t)
Compares two Terms for equality. |
Term |
eval(Instance currentObject,
StackFrame stackframe)
Evaluates a Term. |
abstract boolean |
ge(FSNumber n)
Greater than or equal to comparison of two numbers. |
static FSNumber |
getNumber(double d)
Creates the appropriate FrameScript number for a double. |
abstract double |
getValue()
Gets the value of the number as a double. |
abstract boolean |
gt(FSNumber n)
Greater than comparison of two numbers. |
abstract boolean |
le(FSNumber n)
Less than or equal to comparison of two numbers. |
abstract boolean |
lt(FSNumber n)
Less than comparison of two numbers. |
abstract FSNumber |
mod(FSNumber n)
Gets the modular of two numbers. |
abstract FSNumber |
multiply(FSNumber n)
Multiplies two numbers. |
abstract FSNumber |
negate()
Gets the negative of a number. |
abstract FSNumber |
subtract(FSNumber n)
Subtracts two numbers. |
Methods inherited from class unsw.cse.framescript.Term |
---|
assign, asString, fullMatch, indents, mapVars, match, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FSNumber()
Method Detail |
---|
public Term eval(Instance currentObject, StackFrame stackframe) throws FSException
Term
eval
in class Term
currentObject
- the enclosing instance frame for the code being evaluatedstackframe
- StackFrame that holds the values for any variables
FSException
- if any errors occur in performing the evaluationpublic abstract double getValue()
public abstract FSNumber negate()
public abstract FSNumber add(FSNumber n)
n
- the number being added to this
public abstract FSNumber subtract(FSNumber n)
n
- the number being subtracted from this
public abstract FSNumber multiply(FSNumber n)
n
- the number this is being multiplied by
public abstract FSNumber divide(FSNumber n) throws FSException
n
- the number this is being divided by
FSException
- if n is 0public abstract FSNumber mod(FSNumber n) throws FSException
n
- the modular number
FSException
- if this or n is not an integer or n is 0public abstract boolean lt(FSNumber n)
n
- the potentially larger number
public abstract boolean le(FSNumber n)
n
- the potentially larger number
public abstract boolean gt(FSNumber n)
n
- the potentially smaller number
public abstract boolean ge(FSNumber n)
n
- the potentially smaller number
public abstract boolean eq(FSNumber n)
n
- number this is being compared to
public boolean equals(Term t)
Term
equals
in class Term
t
- Term to be compared to
public static FSNumber getNumber(double d)
d
- the value of the number
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |