Package edu.vt.rt.datastructures.util

Examples of edu.vt.rt.datastructures.util.Box


  @Override
  public boolean add(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableHashMap<E, E>> container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "r");
    final ImmutableHashMap<E, E> map = container.getItem();
    Box found = new Box(null);
    final ImmutableHashMap<E, E> newMap = map.put(value, value, found);
    if (found.value != null) {
      return false;
    }
    container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "w");
View Full Code Here


  @Override
  public boolean remove(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableHashMap<E, E>> container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "r");
    final ImmutableHashMap<E, E> map = container.getItem();
    Box found = new Box(null);
    final ImmutableHashMap<E, E> newMap = map.remove(value, found);
    if (found.value == null) {
      return false;
    }
    container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "w");
View Full Code Here

      throw new NullPointerException();
    }
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<DistributedImmutableHashMap<K,V>> container = (IDContainer<DistributedImmutableHashMap<K,V>>) locator.open(containerID, "r");
    final DistributedImmutableHashMap<K,V> map = container.getItem();
    Box found = new Box(null);
    if (map == null) {
      container.setItem(DistributedImmutableHashMap.EMPTY.put(0, key.hashCode(), key, value, found));
      return null;
    }
    final DistributedImmutableHashMap<K,V> newMap = map.put(0, key.hashCode(), key, value, found);
View Full Code Here

    IDContainer<DistributedImmutableHashMap<K,V>> container = (IDContainer<DistributedImmutableHashMap<K,V>>) locator.open(containerID, "r");
    final DistributedImmutableHashMap<K,V> map = container.getItem();
    if (map == null) {
      return null;
    }
    Box found = new Box(null);
    final DistributedImmutableHashMap<K,V> newMap = map.remove(0, key.hashCode(), key, found);
    if (map.equals(newMap)) {
      return null;
    }
    container = (IDContainer<DistributedImmutableHashMap<K,V>>) locator.open(containerID, "w");
View Full Code Here

TOP

Related Classes of edu.vt.rt.datastructures.util.Box

Copyright © 2018 www.massapicom. 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.