Search in sources :

Example 1 with ImmutableTableColumn

use of org.activityinfo.model.analysis.ImmutableTableColumn in project activityinfo by bedatadriven.

the class EffectiveTableModel method addKeyColumns.

private void addKeyColumns(List<EffectiveTableColumn> columns, FormTree.Node node) {
    LookupKeySet lookupKeySet = new LookupKeySet(formTree, node.getField());
    Map<LookupKey, FormulaNode> formulas = lookupKeySet.getKeyFormulas(node.getFieldId());
    for (LookupKey lookupKey : lookupKeySet.getLookupKeys()) {
        ImmutableTableColumn tableColumn = ImmutableTableColumn.builder().id(node.getFieldId().asString() + "_k" + lookupKey.getKeyIndex()).formula(formulas.get(lookupKey).toString()).label(lookupKey.getKeyLabel()).build();
        columns.add(new EffectiveTableColumn(formTree, tableColumn));
    }
}
Also used : LookupKeySet(org.activityinfo.model.formTree.LookupKeySet) FormulaNode(org.activityinfo.model.formula.FormulaNode) LookupKey(org.activityinfo.model.formTree.LookupKey) ImmutableTableColumn(org.activityinfo.model.analysis.ImmutableTableColumn)

Aggregations

ImmutableTableColumn (org.activityinfo.model.analysis.ImmutableTableColumn)1 LookupKey (org.activityinfo.model.formTree.LookupKey)1 LookupKeySet (org.activityinfo.model.formTree.LookupKeySet)1 FormulaNode (org.activityinfo.model.formula.FormulaNode)1