com.androidplot.util
Class ArrangeableHash<KeyType,ValueType>

java.lang.Object
  extended by com.androidplot.util.ArrangeableHash<KeyType,ValueType>
Direct Known Subclasses:
LayoutManager

public class ArrangeableHash<KeyType,ValueType>
extends Object

Provides a mechanism to quickly retrieve elements via hash key. Also provides mutable ordering of elements.


Constructor Summary
ArrangeableHash()
           
 
Method Summary
 void addFirst(KeyType key, ValueType value)
          If key already exists within the structure, it's value is replaced with the new value and it's existing order is maintained.
 void addLast(KeyType key, ValueType value)
          If key already exists within the structure, it's value is replaced with the new value and it's existing order is maintained.
 ValueType get(KeyType key)
           
 List<KeyType> getKeysAsList()
           
 boolean moveAbove(KeyType objectToMove, KeyType reference)
           
 boolean moveBeneath(KeyType objectToMove, KeyType reference)
           
 boolean moveDown(KeyType key)
           
 boolean moveToBottom(KeyType key)
           
 boolean moveToTop(KeyType element)
           
 boolean moveUp(KeyType key)
           
 boolean remove(KeyType key)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrangeableHash

public ArrangeableHash()
Method Detail

size

public int size()

get

public ValueType get(KeyType key)

getKeysAsList

public List<KeyType> getKeysAsList()

addLast

public void addLast(KeyType key,
                    ValueType value)
If key already exists within the structure, it's value is replaced with the new value and it's existing order is maintained.

Parameters:
key -
value -

addFirst

public void addFirst(KeyType key,
                     ValueType value)
If key already exists within the structure, it's value is replaced with the new value and it's existing order is maintained.

Parameters:
key -
value -

moveToTop

public boolean moveToTop(KeyType element)

moveAbove

public boolean moveAbove(KeyType objectToMove,
                         KeyType reference)

moveBeneath

public boolean moveBeneath(KeyType objectToMove,
                           KeyType reference)

moveToBottom

public boolean moveToBottom(KeyType key)

moveUp

public boolean moveUp(KeyType key)

moveDown

public boolean moveDown(KeyType key)

remove

public boolean remove(KeyType key)


Copyright © 2011. All Rights Reserved.