@Test public void moveBeneath() { layerHash.moveBeneath(obj1, obj2); assertEquals(obj3, layerHash.getKeysAsList().get(0)); assertEquals(obj1, layerHash.getKeysAsList().get(1)); assertEquals(obj2, layerHash.getKeysAsList().get(2)); }
public synchronized boolean moveBeneath(KeyType objectToMove, KeyType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveBeaneath(A, B); A cannot be equal to B."); } if(!hash.containsKey(reference) || !hash.containsKey(objectToMove)) { return false; } else { return zlist.moveBeneath(objectToMove, reference); } }
LayerHash implements Layerable<KeyType> { public synchronized boolean moveBeneath(KeyType objectToMove, KeyType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveBeaneath(A, B); A cannot be equal to B."); } if(!hash.containsKey(reference) || !hash.containsKey(objectToMove)) { return false; } else { return zlist.moveBeneath(objectToMove, reference); } } }
LayerHash implements Layerable<KeyType> { public synchronized boolean moveBeneath(KeyType objectToMove, KeyType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveBeaneath(A, B); A cannot be equal to B."); } if(!hash.containsKey(reference) || !hash.containsKey(objectToMove)) { return false; } else { return zlist.moveBeneath(objectToMove, reference); } }  }
LayerHash implements Layerable<KeyType> { public synchronized boolean moveBeneath(KeyType objectToMove, KeyType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveBeaneath(A, B); A cannot be equal to B."); } if(!hash.containsKey(reference) || !hash.containsKey(objectToMove)) { return false; } else { return zlist.moveBeneath(objectToMove, reference); } }  int size(); ValueType get(KeyType key); List<KeyType> getKeysAsList(); synchronized void addToTop(KeyType key, ValueType value); synchronized void addToBottom(KeyType key, ValueType value); synchronized boolean moveToTop(KeyType element); synchronized boolean moveAbove(KeyType objectToMove, KeyType reference); synchronized boolean moveBeneath(KeyType objectToMove, KeyType reference); synchronized boolean moveToBottom(KeyType key); synchronized boolean moveUp(KeyType key); synchronized boolean moveDown(KeyType key); @Override List<KeyType> elements(); List<KeyType> keys(); synchronized boolean remove(KeyType key); ValueType getTop(); ValueType getBottom(); ValueType getAbove(KeyType key); ValueType getBeneath(KeyType key); }
LayerHash implements Layerable<KeyType> { public synchronized boolean moveBeneath(KeyType objectToMove, KeyType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveBeaneath(A, B); A cannot be equal to B."); } if(!hash.containsKey(reference) || !hash.containsKey(objectToMove)) { return false; } else { return zlist.moveBeneath(objectToMove, reference); } }  int size(); ValueType get(KeyType key); List<KeyType> getKeysAsList(); synchronized void addToTop(KeyType key, ValueType value); synchronized void addToBottom(KeyType key, ValueType value); synchronized boolean moveToTop(KeyType element); synchronized boolean moveAbove(KeyType objectToMove, KeyType reference); synchronized boolean moveBeneath(KeyType objectToMove, KeyType reference); synchronized boolean moveToBottom(KeyType key); synchronized boolean moveUp(KeyType key); synchronized boolean moveDown(KeyType key); @Override List<KeyType> elements(); List<KeyType> keys(); synchronized boolean remove(KeyType key); ValueType getTop(); ValueType getBottom(); ValueType getAbove(KeyType key); ValueType getBeneath(KeyType key);  }