Home | History | Annotate | Download | only in calculator2

Lines Matching defs:Constant

54                                      // as a list of tokens.  Constant
57 private static enum TokenKind { CONSTANT, OPERATOR, PRE_EVAL };
112 * Representation of a (possibly incomplete) numerical constant.
115 private static class Constant extends Token implements Cloneable {
121 Constant() {
128 Constant(DataInput in) throws IOException {
137 out.writeByte(TokenKind.CONSTANT.ordinal());
147 // in this constant.
148 // Assumes that this constant does not have an exponent.
183 * Assumes the constant is nonempty.
203 * Produce human-readable string representation of constant, as typed.
220 * Return BoundedRational representation of constant, if well-formed.
251 return TokenKind.CONSTANT;
257 Constant result = new Constant();
392 case CONSTANT:
393 return new Constant(in);
433 * Does this expression end with a numeric constant?
442 return t instanceof Constant;
484 // Since we treat juxtaposition as multiplication, a constant can appear anywhere.
486 mExpr.add(new Constant());
490 if(!(last instanceof Constant)) {
496 mExpr.add(new Constant());
500 return ((Constant)(mExpr.get(s-1))).add(id);
508 * Add exponent to the constant at the end of the expression.
509 * Assumes there is a constant at the end of the expression.
513 ((Constant) lastTok).addExponent(exp);
545 // Check that we're not concatenating Constant or PreEval tokens, since the result would
546 // look like a single constant, with very mysterious results for the user.
571 if (last instanceof Constant) {
572 Constant c = (Constant)last;
599 if (t instanceof Constant) {
600 result.mExpr.add((Token)(((Constant)t).clone()));
608 // Am I just a constant?
613 return mExpr.get(0) instanceof Constant;
723 if (t instanceof Constant) {
724 Constant c = (Constant)t;
1033 * Is the subexpression starting at pos a simple percent constant?
1035 * This is defined as a Constant or PreEval token, followed by a percent sign, and followed
1063 * @param pos position of Constant or PreEval expression token corresponding to N