
org.diirt.datasource.formula.PrintFunctionSetTable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datasource-formula Show documentation
Show all versions of datasource-formula Show documentation
An extensible formula language suitable for real-time calculation.
The newest version!
/**
* Copyright (C) 2010-18 diirt developers. See COPYRIGHT.TXT
* All rights reserved. Use is subject to license terms. See LICENSE.TXT
*/
package org.diirt.datasource.formula;
import org.diirt.datasource.formula.array.ArrayFunctionSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* Utility class to print an prefilled HTML table from a function set.
*
* @author carcassi
*/
public class PrintFunctionSetTable {
/**
* Entry point for the utility.
*
* @param args command-line arguments
*/
public static void main(String[] args) {
FormulaFunctionSet set = new ArrayFunctionSet();
List functions = new ArrayList<>(set.getFunctions());
Collections.sort(functions, new Comparator() {
@Override
public int compare(FormulaFunction o1, FormulaFunction o2) {
return o1.getName().compareTo(o2.getName());
}
});
System.out.println(" \n" +
" \n" +
" \n" +
" Signature \n" +
" Description \n" +
" Null handling \n" +
" Alarm \n" +
" Time \n" +
" \n" +
" \n" +
" ");
for (FormulaFunction formulaFunction : functions) {
System.out.println(" ");
System.out.println(" " + FormulaFunctions.formatSignature(formulaFunction) + "
");
System.out.println(" " + formulaFunction.getDescription() + " ");
System.out.println(" Null if one of the arguments is null ");
System.out.println(" Highest alarm of the arguments ");
System.out.println(" Latest valid time of the arguments or now if no valid time is found ");
System.out.println(" ");
}
System.out.println(" \n" +
"
");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy