|
|||||||||
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
unsw.cse.framescript.FSInteger
public class FSInteger
This class represents integers in FrameScript.
Field Summary | |
---|---|
long |
iVal
|
Constructor Summary | |
---|---|
FSInteger(long l)
Creates an integer with a given value. |
Method Summary | |
---|---|
FSNumber |
add(FSNumber n)
Adds two numbers. |
FSNumber |
divide(FSNumber n)
Divides two numbers. |
boolean |
eq(FSNumber n)
Compares two numbers for equality. |
boolean |
ge(FSNumber n)
Greater than or equal to comparison of two numbers. |
long |
getInteger()
Gets the value of the integer as a Java primative. |
double |
getValue()
Gets the value of the number as a double. |
boolean |
gt(FSNumber n)
Greater than comparison of two numbers. |
boolean |
le(FSNumber n)
Less than or equal to comparison of two numbers. |
boolean |
lt(FSNumber n)
Less than comparison of two numbers. |
FSNumber |
mod(FSNumber n)
Gets the modular of two numbers. |
FSNumber |
multiply(FSNumber n)
Multiplies two numbers. |
FSNumber |
negate()
Gets the negative of a number. |
FSNumber |
subtract(FSNumber n)
Subtracts two numbers. |
java.lang.String |
toString()
Turns the Term into a string. |
Methods inherited from class unsw.cse.framescript.FSNumber |
---|
equals, eval, getNumber |
Methods inherited from class unsw.cse.framescript.Term |
---|
assign, asString, fullMatch, indents, mapVars, match |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public long iVal
Constructor Detail |
---|
public FSInteger(long l)
l
- the numerical valueMethod Detail |
---|
public long getInteger()
public double getValue()
FSNumber
getValue
in class FSNumber
public FSNumber negate()
FSNumber
negate
in class FSNumber
public FSNumber add(FSNumber n)
FSNumber
add
in class FSNumber
n
- the number being added to this
public FSNumber subtract(FSNumber n)
FSNumber
subtract
in class FSNumber
n
- the number being subtracted from this
public FSNumber multiply(FSNumber n)
FSNumber
multiply
in class FSNumber
n
- the number this is being multiplied by
public FSNumber divide(FSNumber n) throws FSException
FSNumber
divide
in class FSNumber
n
- the number this is being divided by
FSException
- if n is 0public FSNumber mod(FSNumber n) throws FSException
FSNumber
mod
in class FSNumber
n
- the modular number
FSException
- if this or n is not an integer or n is 0public boolean lt(FSNumber n)
FSNumber
lt
in class FSNumber
n
- the potentially larger number
public boolean le(FSNumber n)
FSNumber
le
in class FSNumber
n
- the potentially larger number
public boolean gt(FSNumber n)
FSNumber
gt
in class FSNumber
n
- the potentially smaller number
public boolean ge(FSNumber n)
FSNumber
ge
in class FSNumber
n
- the potentially smaller number
public boolean eq(FSNumber n)
FSNumber
eq
in class FSNumber
n
- number this is being compared to
public java.lang.String toString()
Term
toString
in class Term
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |