cass.rollup.processors.v2.graph.collapser.NodePacket Maven / Gradle / Ivy
package cass.rollup.processors.v2.graph.collapser;
import org.stjs.javascript.Array;
import org.stjs.javascript.JSCollections;
import org.stjs.javascript.Map;
public class NodePacket {
private Array nodeList;
private Map nodeMap;
public NodePacket() {
nodeList = new Array();
nodeMap = JSCollections.$map();
}
public Array getNodeList() {return nodeList;}
public void setNodeList(Array nodeList) {this.nodeList = nodeList;}
public int getNodeCount() {return nodeList.$length();}
public void addNode(Node n) {
if (nodeMap.$get(n.getId()) == null) {
nodeList.push(n);
nodeMap.$put(n.getId(),n);
}
}
public String toString() {
String ret = "";
ret = ret + "NodePacket: (";
for (int i=0;i