|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
org.norther.tammi.acorn.lang.Equation
public abstract class Equation
A numeric equation.
| Constructor Summary | |
|---|---|
Equation(byte[] operands)
Constructs a new byte equation. |
|
Equation(double[] operands)
Constructs a new double equation. |
|
Equation(double[] operands,
boolean ignoreNaNs)
Constructs a new double equation. |
|
Equation(float[] operands)
Constructs a new float equation. |
|
Equation(float[] operands,
boolean ignoreNaNs)
Constructs a new float equation. |
|
Equation(int[] operands)
Constructs a new int equation. |
|
Equation(long[] operands)
Constructs a new long equation. |
|
Equation(short[] operands)
Constructs a new short equation. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
|
byte |
byteValue(int index)
Gets the indexed byte operand. |
protected abstract Number |
calculate(Object operands,
int length,
boolean ignoreNaNs)
Calculates the result. |
int |
compareTo(Object obj)
|
double |
doubleValue()
|
double |
doubleValue(int index)
Gets the indexed double operand. |
boolean |
equals(Object obj)
|
float |
floatValue()
|
float |
floatValue(int index)
Gets the indexed float operand. |
int |
getLength()
Gets the length of the equation. |
Class |
getOperandType()
Gets the type of operands. |
Number |
getResult()
Gets the result. |
int |
intValue()
|
int |
intValue(int index)
Gets the indexed int operand. |
protected boolean |
isFloatingPoint(Object operands)
Checks whether the operands are floating point numbers. |
long |
longValue()
|
long |
longValue(int index)
Gets the indexed long operand. |
short |
shortValue()
|
short |
shortValue(int index)
Gets the indexed short operand. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Equation(byte[] operands)
operands - the operands.public Equation(short[] operands)
operands - the operands.public Equation(int[] operands)
operands - the operands.public Equation(long[] operands)
operands - the operands.public Equation(float[] operands)
operands - the operands.
public Equation(float[] operands,
boolean ignoreNaNs)
operands - the operands.ignoreNaNs - ignore NaNs if true.public Equation(double[] operands)
operands - the operands.
public Equation(double[] operands,
boolean ignoreNaNs)
operands - the operands.ignoreNaNs - ignore NaNs if true.| Method Detail |
|---|
public Number getResult()
public Class getOperandType()
public int getLength()
public byte byteValue(int index)
index - the index.
public short shortValue(int index)
index - the index.
public int intValue(int index)
index - the index.
public long longValue(int index)
index - the index.
public float floatValue(int index)
index - the index.
public double doubleValue(int index)
index - the index.
public byte byteValue()
byteValue in class Numberpublic short shortValue()
shortValue in class Numberpublic int intValue()
intValue in class Numberpublic long longValue()
longValue in class Numberpublic float floatValue()
floatValue in class Numberpublic double doubleValue()
doubleValue in class Numberpublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int compareTo(Object obj)
compareTo in interface Comparableprotected boolean isFloatingPoint(Object operands)
operands - the operands.
protected abstract Number calculate(Object operands,
int length,
boolean ignoreNaNs)
operands - an array of operands.length - the number of operands.ignoreNaNs - ignore NaNs if true.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||