Package aleph.dir

Examples of aleph.dir.DirectoryManager.open()


      locator.delete(this);
      if (this.leftID == null && this.rightID == null) {  //0 Children
        return null;
      }
      if (this.leftID == null || this.rightID == null) {  //1 Child
        return (DistributedImmutableBST<E>)((this.leftID != null) ? locator.open(this.leftID, "r") : locator.open(this.rightID, "r"));
      }
      else //2 Children
        //Find Right Child's left most node
        Stack<DistributedImmutableBST<E>> stack = new Stack<DistributedImmutableBST<E>>();
        DistributedImmutableBST<E> iter = (DistributedImmutableBST<E>) locator.open(this.rightID, "r");
View Full Code Here


        return (DistributedImmutableBST<E>)((this.leftID != null) ? locator.open(this.leftID, "r") : locator.open(this.rightID, "r"));
      }
      else //2 Children
        //Find Right Child's left most node
        Stack<DistributedImmutableBST<E>> stack = new Stack<DistributedImmutableBST<E>>();
        DistributedImmutableBST<E> iter = (DistributedImmutableBST<E>) locator.open(this.rightID, "r");
        while (iter.leftID != null) {
          stack.push(iter);
          iter = (DistributedImmutableBST<E>) locator.open(iter.leftID, "r");
        }
        E newValue = iter.data;
View Full Code Here

        //Find Right Child's left most node
        Stack<DistributedImmutableBST<E>> stack = new Stack<DistributedImmutableBST<E>>();
        DistributedImmutableBST<E> iter = (DistributedImmutableBST<E>) locator.open(this.rightID, "r");
        while (iter.leftID != null) {
          stack.push(iter);
          iter = (DistributedImmutableBST<E>) locator.open(iter.leftID, "r");
        }
        E newValue = iter.data;
        iter = (DistributedImmutableBST<E>) locator.open(iter.rightID, "r")//Don't lose left most child's right nodes
        while (!stack.empty()) {
          DistributedImmutableBST<E> node = stack.pop();
View Full Code Here

        while (iter.leftID != null) {
          stack.push(iter);
          iter = (DistributedImmutableBST<E>) locator.open(iter.leftID, "r");
        }
        E newValue = iter.data;
        iter = (DistributedImmutableBST<E>) locator.open(iter.rightID, "r")//Don't lose left most child's right nodes
        while (!stack.empty()) {
          DistributedImmutableBST<E> node = stack.pop();
          iter = new DistributedImmutableBST<E>(node.data, (String) iter.getId(), node.rightID);
          locator.delete(node);
        }
View Full Code Here

   */
  @Atomic
  @Override
  public boolean add(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableList<E>> container = (IDContainer<ImmutableList<E>>) locator.open(containerID, "r");
    final ImmutableList<E> list = container.getItem();
    if (list == null) {  //List is empty
      container.setItem(new ImmutableList<E>(value));
      return true;
    }
View Full Code Here

    }
    final ImmutableList<E> newList = list.add(value);
    if (newList == list) {
      return false;
    }
    container = (IDContainer<ImmutableList<E>>) locator.open(containerID, "w");
    container.setItem(newList);
    return true;
  }

  /*
 
View Full Code Here

  }

  @Atomic
  private ImmutableList<E> getHead() {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableList<E>> container = (IDContainer<ImmutableList<E>>) locator.open(containerID, "r");
    return container.getItem();
  }

  /*
   * (non-Javadoc)
 
View Full Code Here

   */
  @Atomic
  @Override
  public boolean remove(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableList<E>> container = (IDContainer<ImmutableList<E>>) locator.open(containerID, "r");
    final ImmutableList<E> list = container.getItem();
    if (list == null) {  //List is empty
      return false;
    }
    final ImmutableList<E> newList = list.remove(value);
View Full Code Here

    }
    final ImmutableList<E> newList = list.remove(value);
    if (newList == list) {
      return false;
    }
    container = (IDContainer<ImmutableList<E>>) locator.open(containerID, "w");
    container.setItem(newList);
    return true;
  }

}
View Full Code Here

   */
  @Atomic
  @Override
  public boolean add(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    List<E> list = (List<E>) locator.open(listID, "w");
    return list.add(value);
  }

  /*
   * (non-Javadoc)
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.