|
|||||||||
| 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.FSDouble
public class FSDouble
This class provides FrameScript with real/decimal numbers.
| Constructor Summary | |
|---|---|
FSDouble(double d)
Creates a double 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. |
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 |
| Constructor Detail |
|---|
public FSDouble(double d)
d - the numerical value| Method Detail |
|---|
public double getValue()
FSNumber
getValue in class FSNumberpublic FSNumber negate()
FSNumber
negate in class FSNumberpublic FSNumber add(FSNumber n)
FSNumber
add in class FSNumbern - the number being added to this
public FSNumber subtract(FSNumber n)
FSNumber
subtract in class FSNumbern - the number being subtracted from this
public FSNumber multiply(FSNumber n)
FSNumber
multiply in class FSNumbern - the number this is being multiplied by
public FSNumber divide(FSNumber n)
throws FSException
FSNumber
divide in class FSNumbern - the number this is being divided by
FSException - if n is 0
public FSNumber mod(FSNumber n)
throws FSException
FSNumber
mod in class FSNumbern - the modular number
FSException - if this or n is not an integer or n is 0public boolean lt(FSNumber n)
FSNumber
lt in class FSNumbern - the potentially larger number
public boolean le(FSNumber n)
FSNumber
le in class FSNumbern - the potentially larger number
public boolean gt(FSNumber n)
FSNumber
gt in class FSNumbern - the potentially smaller number
public boolean ge(FSNumber n)
FSNumber
ge in class FSNumbern - the potentially smaller number
public boolean eq(FSNumber n)
FSNumber
eq in class FSNumbern - 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 | ||||||||