All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aksw.jenax.arq.aggregation.AggObject Maven / Gradle / Ivy

The newest version!
package org.aksw.jenax.arq.aggregation;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.apache.jena.sparql.core.Var;

public class AggObject implements Agg> {
    private Map> keyToSubAgg;

    public AggObject() {
        this(new HashMap>());
    }

    public AggObject(Map> keyToSubAgg) {
        this.keyToSubAgg = keyToSubAgg;
    }

    @Override
    public Acc> createAccumulator() {
        Map> keyToSubAcc = new HashMap>();

        for (Entry> entry : keyToSubAgg.entrySet()) {
            K key = entry.getKey();
            Agg agg = entry.getValue();
            Acc acc = agg.createAccumulator();

            keyToSubAcc.put(key, acc);
        }

        Acc> result = new AccObject(keyToSubAcc);
        return result;
    }

    @Override
    public Set getDeclaredVars() {
        // TODO Auto-generated method stub
        return null;
    }

    public static  AggObject create(Map> keyToSubAgg) {
        AggObject result = new AggObject(keyToSubAgg);
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy