Search in sources :

Example 26 with Object

use of java.lang.Object in project dhis2-core by dhis2.

the class MaxValue method run.

// nFunk's JEP run() method uses the raw Stack type
@SuppressWarnings({ "rawtypes", "unchecked" })
public void run(Stack inStack) throws ParseException {
    checkStack(inStack);
    Object param = inStack.pop();
    List<Double> vals = CustomFunctions.checkVector(param);
    Double max = null;
    for (Double v : vals) {
        if (max == null) {
            max = v;
        } else if (v > max) {
            max = v;
        }
    }
    inStack.push(new Double(max));
}
Also used : Object(java.lang.Object)

Aggregations

Object (java.lang.Object)26 String (java.lang.String)7 IOException (java.io.IOException)4 NumberFormatException (java.lang.NumberFormatException)4 Override (java.lang.Override)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)3 List (java.util.List)3 File (java.io.File)2 InputStream (java.io.InputStream)2 OutputStream (java.io.OutputStream)2 Exception (java.lang.Exception)2 IllegalArgumentException (java.lang.IllegalArgumentException)2 IllegalStateException (java.lang.IllegalStateException)2 RuntimeException (java.lang.RuntimeException)2 StringBuilder (java.lang.StringBuilder)2 UnsupportedOperationException (java.lang.UnsupportedOperationException)2 SeekableByteChannel (java.nio.channels.SeekableByteChannel)2 FileSystem (java.nio.file.FileSystem)2 Path (java.nio.file.Path)2