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

cass.rollup.processors.v2.graph.collapser.NodePacket Maven / Gradle / Ivy

There is a newer version: 3.1.8
Show newest version
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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy