org.apache.el.lang.ELArithmetic Java Examples
The following examples show how to use
org.apache.el.lang.ELArithmetic.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Stream.java From Tomcat8-Source-Read with MIT License | 5 votes |
public Optional average() { long count = 0; Number sum = Long.valueOf(0); while (iterator.hasNext()) { count++; sum = ELArithmetic.add(sum, iterator.next()); } if (count == 0) { return Optional.EMPTY; } else { return new Optional(ELArithmetic.divide(sum, Long.valueOf(count))); } }
Example #2
Source File: AstMult.java From Tomcat8-Source-Read with MIT License | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.multiply(obj0, obj1); }
Example #3
Source File: AstMinus.java From Tomcat8-Source-Read with MIT License | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.subtract(obj0, obj1); }
Example #4
Source File: AstDiv.java From Tomcat8-Source-Read with MIT License | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.divide(obj0, obj1); }
Example #5
Source File: AstPlus.java From Tomcat8-Source-Read with MIT License | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.add(obj0, obj1); }
Example #6
Source File: AstMod.java From Tomcat8-Source-Read with MIT License | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.mod(obj0, obj1); }
Example #7
Source File: AstMult.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.multiply(obj0, obj1); }
Example #8
Source File: AstMinus.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.subtract(obj0, obj1); }
Example #9
Source File: AstDiv.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.divide(obj0, obj1); }
Example #10
Source File: AstPlus.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.add(obj0, obj1); }
Example #11
Source File: AstMod.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.mod(obj0, obj1); }
Example #12
Source File: AstMult.java From tomcatsrc with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.multiply(obj0, obj1); }
Example #13
Source File: AstMinus.java From tomcatsrc with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.subtract(obj0, obj1); }
Example #14
Source File: AstDiv.java From tomcatsrc with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.divide(obj0, obj1); }
Example #15
Source File: AstPlus.java From tomcatsrc with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.add(obj0, obj1); }
Example #16
Source File: AstMod.java From tomcatsrc with Apache License 2.0 | 5 votes |
@Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj0 = this.children[0].getValue(ctx); Object obj1 = this.children[1].getValue(ctx); return ELArithmetic.mod(obj0, obj1); }