|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.Vector
|
+--com.rubecula.jquantity.Expression
Class to manage a mathematical expression. It is the Presentable counterpart to SymbolicPresentation. Elements, the order of which is important, are either of:
Replaceable
(which extends Presentable
and java.util.Vector only, nevertheless it uses numerical classes such as
BaseNumber and the abstract class of Item.
This doesn't seem quite right.
| Nested Class Summary | |
(package private) static class |
Expression.ExpressionException
Static class to define an exception encountered when parsing a formula. |
| Nested classes inherited from class java.util.AbstractList |
|
| Field Summary |
| Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
Expression()
Constructor for an empty formula. |
|
Expression(Presentable presentable)
Constructor for an "anadic" formula of all strings. |
|
| Method Summary | |
java.lang.String |
getType()
This method is primarily for development purposes: it yields the name of the class of the presentable object or, in some cases, the class of the presentable object indirectly referenced. |
Presentable |
getValue()
Method to evaluate this expression. |
Presentable |
getValue(java.lang.Object ignored)
This method takes this Expression and returns its logical equivalent, i.e. |
static void |
main(java.lang.String[] args)
Main method for testing this class. |
Presentable |
makePresentableInstance(Presentation presentation)
Instance method to convert a Presentation into a Presentable. |
static Presentable |
Parse(Presentation presentation)
Create a Rational from a Presentation and return it as a Presentable. |
static Expression |
Parse(SymbolicPresentation presentation,
java.lang.String identifier)
Translates the SymbolicPresentation representation of an expression into an instance of Expression. |
Presentation |
present()
Convert this Presentable object into a Presentation with default attributes. |
Presentation |
present(AttrMap attributes)
Convert this Presentable object into a Presentation, according to the set of attributes provided. |
protected static void |
testExpression(java.io.PrintStream out,
SymbolicPresentation sp,
java.lang.String label)
|
| Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
| Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
iterator, listIterator, listIterator |
| Constructor Detail |
public Expression()
public Expression(Presentable presentable)
presentable - the presentable to form this singleton expression.| Method Detail |
public static Expression Parse(SymbolicPresentation presentation,
java.lang.String identifier)
throws PresentationException
presentation - SymbolicPresentation representation to interpret.identifier - A string with which to identify this Rational.
PresentationException - if the presentation cannot be parsed as an
Expression.
public Presentable getValue()
throws PresentableException
PresentableException - name not be found.
public Presentable getValue(java.lang.Object ignored)
throws PresentableException
getValue in interface Replaceableignored - Not used.
PresentableException
public Presentation present(AttrMap attributes)
throws PresentationException
present in interface Presentableattributes - a map of desired attributes for this presentation.
PresentationException - if formula cannot be presented with
given attributes.
public Presentation present()
throws PresentationException
PresentationException - if formula cannot be presented with
given attributes.public java.lang.String getType()
getType in interface Presentable
public Presentable makePresentableInstance(Presentation presentation)
throws PresentationException
makePresentableInstance in interface Presentablepresentation - of a number to be converted into a Presentable number.
PresentationException - if presentation cannot be parsed appropriately.
public static Presentable Parse(Presentation presentation)
throws PresentationException
presentation - A presentation which should be parsed to form a Presentable.
PresentationException - if the presentation cannot be parsed as a
Presentable object.
protected static void testExpression(java.io.PrintStream out,
SymbolicPresentation sp,
java.lang.String label)
public static void main(java.lang.String[] args)
args - String[] : the command line options.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||