Tabnine Logo
Operation
Code IndexAdd Tabnine to your IDE (free)

How to use
Operation
in
com.wizzardo.tools.evaluation

Best Java code snippets using com.wizzardo.tools.evaluation.Operation (Showing top 17 results out of 315)

origin: com.wizzardo.tools/tools-evaluation

private void simplify() {
  if (!checkedForSimplify) {
    synchronized (this) {
      if (!checkedForSimplify) {
        if (leftPart != null && leftPart.hardcoded && leftPart.result instanceof Number) {
          if (checkForSimplify(operator, rightPart))
            switchHardcodedParts(this, (Operation) rightPart);
        } else if (rightPart != null && rightPart.hardcoded && rightPart.result instanceof Number) {
          if (checkForSimplify(operator, leftPart))
            switchHardcodedParts(this, (Operation) leftPart);
        }
        checkedForSimplify = true;
      }
    }
  }
}
origin: wizzardo/tools

private static Object ne(Object ob1, Object ob2) {
  return !e(ob1, ob2);
}
origin: com.wizzardo.tools/tools-evaluation

  result = plus(ob1, ob2, operator);
  break;
  result = minus(ob1, ob2);
  break;
  result = multiply(ob1, ob2);
  break;
  result = divide(ob1, ob2);
  break;
case PLUS2:
case MINUS2: {
  result = set(leftPart, rightPart, model, operator);
  break;
  result = gt(ob1, ob2);
  break;
  result = lt(ob1, ob2);
  break;
  result = gte(ob1, ob2);
  break;
  result = lte(ob1, ob2);
  break;
origin: com.wizzardo.tools/tools-evaluation

  Object r = increment(left);
  setter.set(thatObject, r);
  return left;
  Object ob = increment(right);
  setter.set(thatObject, ob);
  return ob;
  Object ob = decrement(right);
  setter.set(thatObject, ob);
  return ob;
  Object r = decrement(left);
  setter.set(thatObject, r);
  return left;
Object r = plus(left, right, operator);
setter.set(thatObject, r);
return r;
Object r = minus(left, right);
setter.set(thatObject, r);
return r;
Object r = multiply(left, right);
setter.set(thatObject, r);
return r;
Object r = divide(left, right);
origin: com.wizzardo.tools/tools-evaluation

  Function.Getter getter = function.getGetter(ob1);
  if (operator != null && getter != null && setter != null) {
    return setAndReturn(ob1, setter, getter.get(ob1), ob2, operator);
    && operation.operator() == Operator.GET) {
  ob1 = operation.leftPart().get(model);
  if (ob1 instanceof Map) {
    Object key = operation.rightPart().get(model);
    if (key instanceof TemplateBuilder.GString)
      key = key.toString();
      return setAndReturn(ob1, new Function.MapSetter(key), m.get(key), ob2, operator);
    return ob2;
  int index = ((Number) operation.rightPart().get(model)).intValue();
  if (ob1 instanceof List) {
    List l = (List) ob1;
  Function.Setter setter = function.getSetter(thatObject);
  if (getter != null && setter != null) {
    return setAndReturn(thatObject, setter, null, getter.get(thatObject), operator);
Variable v = getVariable(leftPart, rightPart);
if (v != null)
  return setAndReturn(null, v, ob1, ob2, operator);
return setAndReturn(model, new Function.MapSetter(leftPart != null ? leftPart.raw() : rightPart.raw()), ob1, ob2, operator);
origin: wizzardo/tools

    operation.end(m.start());
    operation.rightPart(lastExpressionHolder);
  operation = new Operation(lastExpressionHolder, Operator.get(m.group()), last, m.end());
  operations.add(operation);
    operation.rightPart(lastExpressionHolder);
    break;
if (last != exp.length()) {
  exps.add(exp.substring(last).trim());
  operation.end(exp.length());
  operation.rightPart(prepare(exp.substring(last), model, functions, imports, isTemplate));
  int n = 0;
  for (int i = 0; i < operations.size(); i++) {
    if (operation == null || operations.get(i).operator().priority > operation.operator().priority) {
      operation = operations.get(i);
      n = i;
  if (operation.operator() == Operator.TERNARY) {
    int ternaryIndex = n;
    operation = null;
    n = 0;
    for (int i = 0; i < ternaryIndex; i++) {
      if (operation == null || operations.get(i).operator().priority > operation.operator().priority) {
        operation = operations.get(i);
origin: wizzardo/tools

Assert.assertEquals(0, eh.get(model));
Assert.assertEquals(0, eh.get(model));
Assert.assertTrue(((Operation) eh).leftPart().hardcoded);
Assert.assertEquals(4, eh.get(model));
Assert.assertEquals(4, eh.get(model));
Assert.assertTrue(((Operation) eh).leftPart().hardcoded);
Assert.assertEquals(1, eh.get(model));
Assert.assertEquals(1, eh.get(model));
Assert.assertTrue(((Operation) eh).leftPart().hardcoded);
Assert.assertEquals(3, eh.get(model));
Assert.assertEquals(3, eh.get(model));
Assert.assertTrue(((Operation) eh).leftPart().hardcoded);
Assert.assertEquals(8, eh.get(model));
Assert.assertEquals(8, eh.get(model));
Assert.assertTrue(((Operation) eh).leftPart().hardcoded);
Assert.assertEquals(6, eh.get(model));
Assert.assertEquals(6, eh.get(model));
Assert.assertTrue(((Operation) eh).leftPart().hardcoded);
Assert.assertEquals("-1b", eh.get(model));
Assert.assertEquals("-1b", eh.get(model));
Assert.assertTrue(((Operation) eh).rightPart().hardcoded);
Assert.assertEquals("b", ((Operation) eh).rightPart().result);
origin: wizzardo/tools

@Override
public Operation clone() {
  return new Operation(leftPart == null ? null : leftPart.clone(), rightPart == null ? null : rightPart.clone(), operator);
}
origin: com.wizzardo.tools/tools-evaluation

if (ob2 instanceof Collection) {
  if (o == Operator.PLUS) {
    Collection c = createNewCollection((Collection) ob1);
    c.addAll((Collection) ob2);
    return c;
} else {
  if (o == Operator.PLUS) {
    Collection c = createNewCollection((Collection) ob1);
    c.add(ob2);
    return c;
origin: wizzardo/tools

  result = plus(ob1, ob2, operator);
  break;
  result = minus(ob1, ob2);
  break;
  result = multiply(ob1, ob2);
  break;
  result = divide(ob1, ob2);
  break;
case PLUS2:
case MINUS2: {
  result = set(leftPart, rightPart, model, operator);
  break;
  result = gt(ob1, ob2);
  break;
  result = lt(ob1, ob2);
  break;
  result = gte(ob1, ob2);
  break;
  result = lte(ob1, ob2);
  break;
origin: wizzardo/tools

  Object r = increment(left);
  setter.set(thatObject, r);
  return left;
  Object ob = increment(right);
  setter.set(thatObject, ob);
  return ob;
  Object ob = decrement(right);
  setter.set(thatObject, ob);
  return ob;
  Object r = decrement(left);
  setter.set(thatObject, r);
  return left;
Object r = plus(left, right, operator);
setter.set(thatObject, r);
return r;
Object r = minus(left, right);
setter.set(thatObject, r);
return r;
Object r = multiply(left, right);
setter.set(thatObject, r);
return r;
Object r = divide(left, right);
origin: wizzardo/tools

  Function.Getter getter = function.getGetter(ob1);
  if (operator != null && getter != null && setter != null) {
    return setAndReturn(ob1, setter, getter.get(ob1), ob2, operator);
    && operation.operator() == Operator.GET) {
  ob1 = operation.leftPart().get(model);
  if (ob1 instanceof Map) {
    Object key = operation.rightPart().get(model);
    if (key instanceof TemplateBuilder.GString)
      key = key.toString();
      return setAndReturn(ob1, new Function.MapSetter(key), m.get(key), ob2, operator);
    return ob2;
  int index = ((Number) operation.rightPart().get(model)).intValue();
  if (ob1 instanceof List) {
    List l = (List) ob1;
  Function.Setter setter = function.getSetter(thatObject);
  if (getter != null && setter != null) {
    return setAndReturn(thatObject, setter, null, getter.get(thatObject), operator);
Variable v = getVariable(leftPart, rightPart);
if (v != null)
  return setAndReturn(null, v, ob1, ob2, operator);
return setAndReturn(model, new Function.MapSetter(leftPart != null ? leftPart.raw() : rightPart.raw()), ob1, ob2, operator);
origin: com.wizzardo.tools/tools-evaluation

    operation.end(m.start());
    operation.rightPart(lastExpressionHolder);
  operation = new Operation(lastExpressionHolder, Operator.get(m.group()), last, m.end());
  operations.add(operation);
    operation.rightPart(lastExpressionHolder);
    break;
if (last != exp.length()) {
  exps.add(exp.substring(last).trim());
  operation.end(exp.length());
  operation.rightPart(prepare(exp.substring(last), model, functions, imports, isTemplate));
  int n = 0;
  for (int i = 0; i < operations.size(); i++) {
    if (operation == null || operations.get(i).operator().priority > operation.operator().priority) {
      operation = operations.get(i);
      n = i;
  if (operation.operator() == Operator.TERNARY) {
    int ternaryIndex = n;
    operation = null;
    n = 0;
    for (int i = 0; i < ternaryIndex; i++) {
      if (operation == null || operations.get(i).operator().priority > operation.operator().priority) {
        operation = operations.get(i);
origin: com.wizzardo.tools/tools-evaluation

@Override
public Operation clone() {
  return new Operation(leftPart == null ? null : leftPart.clone(), rightPart == null ? null : rightPart.clone(), operator);
}
origin: wizzardo/tools

if (ob2 instanceof Collection) {
  if (o == Operator.PLUS) {
    Collection c = createNewCollection((Collection) ob1);
    c.addAll((Collection) ob2);
    return c;
} else {
  if (o == Operator.PLUS) {
    Collection c = createNewCollection((Collection) ob1);
    c.add(ob2);
    return c;
origin: wizzardo/tools

private void simplify() {
  if (!checkedForSimplify) {
    synchronized (this) {
      if (!checkedForSimplify) {
        if (leftPart != null && leftPart.hardcoded && leftPart.result instanceof Number) {
          if (checkForSimplify(operator, rightPart))
            switchHardcodedParts(this, (Operation) rightPart);
        } else if (rightPart != null && rightPart.hardcoded && rightPart.result instanceof Number) {
          if (checkForSimplify(operator, leftPart))
            switchHardcodedParts(this, (Operation) leftPart);
        }
        checkedForSimplify = true;
      }
    }
  }
}
origin: com.wizzardo.tools/tools-evaluation

private static Object ne(Object ob1, Object ob2) {
  return !e(ob1, ob2);
}
com.wizzardo.tools.evaluationOperation

Most used methods

  • leftPart
  • rightPart
  • <init>
  • append
  • checkForSimplify
  • createNewCollection
  • createRange
  • decrement
  • divide
  • e
  • end
  • get
  • end,
  • get,
  • getOperator,
  • getVariable,
  • gt,
  • gte,
  • increment,
  • lt,
  • lte,
  • minus

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • setScale (BigDecimal)
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collectors (java.util.stream)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now