|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.foray.ps.PsNumber
public abstract class PsNumber
Superclass for numeric Postscript data types.
PsInteger,
PsReal| Constructor Summary | |
|---|---|
PsNumber(BigDecimal value)
Constructor. |
|
| Method Summary | |
|---|---|
PsNumber |
add(PsNumber amount)
Adds a given amount to the value of this object, returning either this object with its value adjusted, or, if this object is unable to represent the value properly, a new object which can. |
abstract PsNumber |
clone()
|
int |
compareTo(PsNumber object)
|
PsNumber |
divide(PsNumber amount)
Divides this number by a given object, returning either this object with its value adjusted, or, if this object is unable to represent the value properly, a new object which can. |
boolean |
equals(Object object)
|
double |
getDoubleValue()
Return the value of this numeric item cast as a double. |
float |
getFloatValue()
Return the value of this numeric item cast as a float. |
BigDecimal |
getValue()
Return the encapsulated value. |
protected static boolean |
isAlphabetic(byte input)
Tests whether the input byte is alphabetic (A-Z and a-z). |
boolean |
isComparable(PsObject object)
Test the comparability of two PSObjects. |
protected static boolean |
isMember(byte[] testSet,
byte input)
Tests whether byte input is a member of set testSet. |
protected static boolean |
isNumeral(byte input)
Tests whether the input byte is a numeral. |
PsNumber |
multiply(PsNumber amount)
Multiplies a given number by this object, returning either this object with its value adjusted, or, if this object is unable to represent the value properly, a new object which can. |
PsNumber |
negate()
Returns the negative of this number. |
void |
round()
Rounds the value. |
PsNumber |
subtract(PsNumber amount)
Subtracts a given amount from the value of this object, returning either this object with its value adjusted, or, if this object is unable to represent the value properly, a new object which can. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.foray.ps.PsObject |
|---|
duplicate, getTypeName, isComposite, isExecutable |
| Constructor Detail |
|---|
public PsNumber(BigDecimal value)
value - The encapsulated value for this object.| Method Detail |
|---|
public abstract PsNumber clone()
clone in class Objectpublic double getDoubleValue()
public float getFloatValue()
public void round()
protected static boolean isNumeral(byte input)
input - The input byte.
protected static boolean isAlphabetic(byte input)
input - The input byte.
protected static boolean isMember(byte[] testSet,
byte input)
testSet - A byte array containing the set to be tested.input - The byte to be tested.
public boolean isComparable(PsObject object)
PsObject
isComparable in interface PsObjectobject - The object that should be tested for comparability.
this is comparable to object,
false otherwise.public boolean equals(Object object)
equals in class Objectpublic int compareTo(PsNumber object)
compareTo in interface Comparable<PsNumber>public PsNumber add(PsNumber amount)
amount - The amount which should be added to the value of this number.
public PsNumber subtract(PsNumber amount)
amount - The amount which should be subtracted from the value of this number.
public PsNumber multiply(PsNumber amount)
amount - The amount which should be multiplied by the value of this number.
public PsNumber divide(PsNumber amount)
amount - The amount which should be divided into the value of this number.
public PsNumber negate()
public BigDecimal getValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||