Package ket.math

Examples of ket.math.Token


    int i;
    boolean loop;
    public Presentation() {
      i = 0;
      loop = true;
      target = new Token(new Text("goal:"));
      argument = parse("integral(ln:x, x)");
      getSelection().getCurrent().getEquation().addBefore(new Equation(target));
      getSelection().getCurrent().getEquation().addBefore(new Equation(argument));
    }
View Full Code Here


      if (getSelection().getCurrent()==target || getSelection().getCurrent()==argument) {
        getSelection().appendEquation(new Equation());
      }
      synchronized (getSelection()) {
        synchronized (target) {
          Argument u = new Token(new Text((titles[i])));
          target.replace(u);
          target = u;
        }
        synchronized (argument) {
          Argument v = parse(acts[i]);
          argument.replace(v);
          argument = v;
        }
        getSelection().replace(new Token(Math.random()));
        modes.getDocument().updateAndRepaint();
      }
    }
View Full Code Here

  @Override
  public void replaceByText(String text) {
    for (State s : options) {
      if (s.toUnicode().equals(text)) {
        getSelection().replace(new Token(s));
      }
    }
  }
View Full Code Here

  @Override
  public void replaceByText(String text) {
    for (Symbol symbol : Symbol.LOWER_CASE_GREEK_LETTERS) {
      if (symbol.toUnicode().equals(text)) {
        getSelection().replace(new Token(symbol));
      }
    }
  }
View Full Code Here

  @Override
  public void replaceByText(String text) {
    for (Symbol symbol : Symbol.UPPER_CASE_GREEK_LETTERS) {
      if (symbol.toUnicode().equals(text)) {
        getSelection().replace(new Token(symbol));
      }
    }
  }
View Full Code Here

      while (n>1) {
        n = findNextFactor(n);
      }
    } else {
      // Otherwise keep what is left of the number.
      terms.add(new Token(n));
    }
  }
View Full Code Here

        return power;
    }
  }

  private Argument toPower(int mantissa, int exponent) {
    Token m = new Token(mantissa);
    if (exponent>1) {
      Token e = new Token(exponent);
      return new Branch(Function.POWER, m, e);
    } else {
      return m;
    }
  }
View Full Code Here

TOP

Related Classes of ket.math.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.