Example #1
0
  private static synchronized GRIBTNode getChild(int AS, GRIBTNode parent) {
    GRIBTNode child = null;
    TLinkedList childs = parent.getChilds();
    if (childs != null && !childs.isEmpty()) {

      for (int i = 0; i < childs.size(); i++) {
        if (((GRIBTNode) childs.get(i)).AS == AS) child = (GRIBTNode) childs.get(i);
      }
    }
    return child;
  }
Example #2
0
 public static synchronized void decreaseRefCount(GRIBTNode node) {
   if (phaseOne) {
     --(node.refCount);
     GRIBTNode parent = node.parent;
     while (parent != root) {
       --(parent.refCount);
       parent = parent.parent;
     }
     --root.refCount;
     if (node.refCount == 0 && node.getChilds().isEmpty() && node != root)
       removeChild(node.parent, node);
   }
 }
Example #3
0
 /** Check if this entry exist in a certain parent tree */
 public static boolean isChild(GRIBTNode parent, GRIBTNode child) {
   if (parent.getChilds().contains(child)) return true;
   else return false;
 }
Example #4
0
 /** Remove an existing child from a certain parent tree */
 private static synchronized void removeChild(GRIBTNode parent, GRIBTNode child) {
   if (parent == null) System.out.println("Null");
   parent.getChilds().remove(child);
 }
Example #5
0
 /** Add a new child to a certain parent tree */
 private static synchronized void addChild(GRIBTNode parent, GRIBTNode child) {
   parent.getChilds().add(child);
 }