cass.rollup.processors.v2.graph.util.NodeRelationMap Maven / Gradle / Ivy
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