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

cass.rollup.processors.v2.graph.util.NodeRelationMap Maven / Gradle / Ivy

There is a newer version: 3.1.8
Show newest version
package cass.rollup.processors.v2.graph.util;

import cass.rollup.processors.v2.graph.collapser.Node;
import cass.rollup.processors.v2.graph.collapser.NodeRelation;
import org.stjs.javascript.Array;
import org.stjs.javascript.JSCollections;
import org.stjs.javascript.Map;

public class NodeRelationMap {

    private Array nodeList;
    private Map> relationMap;

    public NodeRelationMap() {
        nodeList = new Array();
        relationMap = JSCollections.$map();
    }

    public void addNodeRelations(Node n, Array rm) {
        nodeList.push(n);
        relationMap.$put(n.getId(),rm);
    }

    public Array getRelationsForNode(Node n) {return relationMap.$get(n.getId());}

    public Array getNodeList() {return nodeList;}
    public void setNodeList(Array nodeList) {this.nodeList = nodeList;}

    public Map> getRelationMap() {return relationMap;}
    public void setRelationMap(Map> relationMap) {this.relationMap = relationMap;}

    public String toString() {
        String ret = "";
        Node n;
        Array nra;
        for (int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy