|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rubecula.util.Symbol com.rubecula.jquantity.Operator
This class defines operators in the context of SymbolicPresentations and their Presentable counterparts: Expressions. It is not directly related to the Mill operator objects.
Copyright: Copyright (c) 2003
Company: Rubecula Software
Field Summary | |
private int |
_Ady
The -ady of this operator, i.e. the number of operands on which it operates. |
static Operator[] |
$AllOps
|
static Operator |
$Braces
|
static Operator |
$Chs
|
static Operator |
$Comma
|
static Operator |
$Divide
|
static Operator |
$E
|
static Operator |
$Exponent
|
static Operator |
$Imag
|
static Operator |
$Minus
|
static Operator |
$Pi
|
static Operator |
$Plus
|
static Operator |
$Times
|
private static java.lang.String |
S_Braces
|
private static java.lang.String |
S_Comma
|
private static java.lang.String |
S_Divide
|
private static java.lang.String |
S_Exponent
|
private static java.lang.String |
S_Imag
|
private static java.lang.String |
S_Minus
|
private static java.lang.String |
S_Pi
|
private static java.lang.String |
S_Plus
|
private static java.lang.String |
S_Times
|
Fields inherited from class com.rubecula.util.Symbol |
_S |
Constructor Summary | |
Operator()
This empty constructor is necessary for the makePresentableInstance method to have something to work on. |
|
Operator(java.lang.String s)
|
|
Operator(java.lang.String s,
int ady)
|
Method Summary | |
int |
getAdy()
|
Presentable |
getValue(java.lang.Object context)
This method takes this Replaceable and returns its logical equivalent as defined by the context. |
Presentable |
makePresentableInstance(Presentation presentation)
Instance method to convert a Presentation into a Presentable. |
boolean |
match(Operator o)
Method to match this operator to another. |
boolean |
match(java.lang.String s,
int ady)
Method to match this operator to a String and ady. |
static Operator |
MatchAny(Operator[] ops,
java.lang.String s,
int ady)
Method to match a String and ady to one of the operators in array ops. |
java.lang.String |
toString()
|
static Operator |
valueOf()
|
static Operator |
valueOf(java.lang.String operator)
|
static Operator |
valueOf(java.lang.String operator,
int ady)
|
Methods inherited from class com.rubecula.util.Symbol |
getType, present |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.rubecula.util.Presentable |
getType, present |
Field Detail |
private static final java.lang.String S_Plus
private static final java.lang.String S_Minus
private static final java.lang.String S_Times
private static final java.lang.String S_Braces
private static final java.lang.String S_Comma
private static final java.lang.String S_Divide
private static final java.lang.String S_Exponent
private static final java.lang.String S_Imag
private static final java.lang.String S_Pi
public static final Operator $Braces
public static final Operator $Chs
public static final Operator $Comma
public static final Operator $Divide
public static final Operator $E
public static final Operator $Exponent
public static final Operator $Imag
public static final Operator $Minus
public static final Operator $Pi
public static final Operator $Plus
public static final Operator $Times
public static final Operator[] $AllOps
private final int _Ady
Constructor Detail |
public Operator(java.lang.String s, int ady)
public Operator(java.lang.String s)
public Operator()
Method Detail |
public static Operator valueOf(java.lang.String operator, int ady) throws PresentableException
PresentableException
public static Operator valueOf(java.lang.String operator) throws PresentableException
PresentableException
public static Operator valueOf() throws PresentableException
PresentableException
public int getAdy()
public java.lang.String toString()
toString
in class Symbol
public boolean match(java.lang.String s, int ady)
s
- the string to match on.ady
- Either the "ady" (0, 1 or 2), or -1 to signify "don't care".
public boolean match(Operator o)
o
- the operator to match.
public static Operator MatchAny(Operator[] ops, java.lang.String s, int ady)
ops
- an array of operatorss
- the string to match on.ady
- Either the "ady" (0, 1 or 2), or -1 to signify "don't care".
public Presentable getValue(java.lang.Object context) throws PresentableException
getValue
in interface Replaceable
context
- an Object which defines the context for the substitution,
for example, an operator or variable for a Mill might be evaluated in the
context of a current Mill and the result would be the replacement.
PresentableException
public Presentable makePresentableInstance(Presentation presentation) throws PresentationException
makePresentableInstance
in interface Presentable
makePresentableInstance
in class Symbol
presentation
- of a number to be converted into a Presentable number.
PresentationException
- in case of parsing error.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |