|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.isi.stella.Stella_Object
edu.isi.stella.Quantity
edu.isi.stella.utilities.Ratio
public class Ratio
| Field Summary | |
|---|---|
int |
denominator
|
int |
numerator
|
| Constructor Summary | |
|---|---|
Ratio()
|
|
| Method Summary | |
|---|---|
static Stella_Object |
accessRatioSlotValue(Ratio self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
|
Ratio |
add(Ratio y)
|
Quantity |
coerceTo(Stella_Object y)
Coerces y to be a compatible type with x. |
static Cons |
computeMeasuresForPrimeId(Ratio pid,
java.lang.Object[] MV_returnarray)
Returns two CONSes of Measure objects for the prime ID pid |
static java.lang.String |
computeUnitsForPrimeId(Ratio pid)
|
Ratio |
divide(Ratio y)
|
Ratio |
exponentiate(int y)
|
boolean |
greaterEqualP(Stella_Object y)
Computes x >= y |
boolean |
greaterP(Stella_Object y)
Computes x > y |
int |
hashCode_()
Return a hash code for self (can be negative). |
Ratio |
invert()
|
boolean |
lessEqualP(Stella_Object y)
Computes x <= y |
boolean |
lessP(Stella_Object y)
Computes x < y |
static Ratio |
makeRatio(int num,
int denom)
|
Ratio |
multiply(Ratio y)
|
Ratio |
negate()
|
static Ratio |
newRatio(int numerator,
int denominator)
|
boolean |
objectEqlP(Stella_Object y)
|
Surrogate |
primaryType()
Returns the primary type of self. |
void |
printObject(java.io.PrintStream stream)
|
Ratio |
subtract(Ratio y)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int numerator
public int denominator
| Constructor Detail |
|---|
public Ratio()
| Method Detail |
|---|
public static Ratio makeRatio(int num,
int denom)
public static Ratio newRatio(int numerator,
int denominator)
public static java.lang.String computeUnitsForPrimeId(Ratio pid)
public static Cons computeMeasuresForPrimeId(Ratio pid,
java.lang.Object[] MV_returnarray)
pid
pid - MV_returnarray -
public Ratio exponentiate(int y)
public Ratio invert()
public Ratio negate()
public Ratio divide(Ratio y)
public Ratio multiply(Ratio y)
public Ratio subtract(Ratio y)
public Ratio add(Ratio y)
public boolean greaterP(Stella_Object y)
x > y
greaterP in class Quantityy -
public boolean greaterEqualP(Stella_Object y)
x >= y
greaterEqualP in class Quantityy -
public boolean lessEqualP(Stella_Object y)
x <= y
lessEqualP in class Quantityy -
public boolean lessP(Stella_Object y)
x < y
lessP in class Quantityy -
public boolean objectEqlP(Stella_Object y)
objectEqlP in class Stella_Objectpublic Quantity coerceTo(Stella_Object y)
y to be a compatible type with x.
If this isn't possible, an exception is thrown. The exception
will be either INCOMPATIBLE-QUANTITY-EXCEPTION or
INCOMPATIBLE-UNITS-EXCEPTION.
coerceTo in class Quantityy -
public int hashCode_()
Stella_Objectself (can be negative). Two objects that are eqlP
are guaranteed to generate the same hash code. Two objects that are not eqlP
do not necessarily generate different hash codes.
hashCode_ in class Stella_Objectpublic void printObject(java.io.PrintStream stream)
printObject in class Stella_Object
public static Stella_Object accessRatioSlotValue(Ratio self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
public Surrogate primaryType()
Stella_Objectself.
Gets defined automatically for every non-abstract subclass of OBJECT.
primaryType in class Stella_Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||