|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
edu.jas.util.DistHashTable<K,V>
public class DistHashTable<K,V>
Distributed version of a HashTable. Implemented with a SortedMap / TreeMap to keep the sequence order of elements.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Field Summary | |
|---|---|
protected ChannelFactory |
cf
|
protected SocketChannel |
channel
|
protected edu.jas.util.DHTListener<K,V> |
listener
|
protected java.util.SortedMap<K,V> |
theList
|
| Constructor Summary | |
|---|---|
DistHashTable(ChannelFactory cf,
java.lang.String host,
int port)
DistHashTable. |
|
DistHashTable(SocketChannel sc)
DistHashTable. |
|
DistHashTable(java.lang.String host)
Constructs a new DistHashTable. |
|
DistHashTable(java.lang.String host,
int port)
DistHashTable. |
|
| Method Summary | |
|---|---|
void |
clear()
Clear the List. |
boolean |
containsKey(java.lang.Object o)
Contains key. |
boolean |
containsValue(java.lang.Object o)
Contains value. |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Get the entries as Set. |
boolean |
equals(java.lang.Object o)
Equals. |
V |
get(java.lang.Object key)
Get value under key from DHT. |
java.util.SortedMap<K,V> |
getList()
Get the internal sorted map. |
java.util.List<V> |
getValueList()
Get the internal list, convert from Collection. |
V |
getWait(K key)
Get value under key from DHT. |
int |
hashCode()
Hash code. |
boolean |
isEmpty()
Is the List empty? |
java.util.Iterator<K> |
iterator()
List key iterator. |
java.util.Set<K> |
keySet()
Get the keys as set. |
V |
put(K key,
V value)
Put object to the distributed hash table. |
void |
putWait(K key,
V value)
Put object to the distributed hash table. |
int |
size()
Size of the (local) list. |
void |
terminate()
Terminate the list thread. |
java.util.Iterator<V> |
valueIterator()
List value iterator. |
java.util.Collection<V> |
values()
Get the values as Collection. |
| Methods inherited from class java.util.AbstractMap |
|---|
clone, putAll, remove, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.SortedMap<K,V> theList
protected final ChannelFactory cf
protected SocketChannel channel
protected edu.jas.util.DHTListener<K,V> listener
| Constructor Detail |
|---|
public DistHashTable(java.lang.String host)
host - name or IP of server host.
public DistHashTable(java.lang.String host,
int port)
host - name or IP of server host.port - on server.
public DistHashTable(ChannelFactory cf,
java.lang.String host,
int port)
cf - ChannelFactory to use.host - name or IP of server host.port - on server.public DistHashTable(SocketChannel sc)
sc - SocketChannel to use.| Method Detail |
|---|
public int hashCode()
hashCode in interface java.util.Map<K,V>hashCode in class java.util.AbstractMap<K,V>public boolean equals(java.lang.Object o)
equals in interface java.util.Map<K,V>equals in class java.util.AbstractMap<K,V>public boolean containsKey(java.lang.Object o)
containsKey in interface java.util.Map<K,V>containsKey in class java.util.AbstractMap<K,V>public boolean containsValue(java.lang.Object o)
containsValue in interface java.util.Map<K,V>containsValue in class java.util.AbstractMap<K,V>public java.util.Collection<V> values()
values in interface java.util.Map<K,V>values in class java.util.AbstractMap<K,V>public java.util.Set<K> keySet()
keySet in interface java.util.Map<K,V>keySet in class java.util.AbstractMap<K,V>public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet in interface java.util.Map<K,V>entrySet in class java.util.AbstractMap<K,V>public java.util.List<V> getValueList()
public java.util.SortedMap<K,V> getList()
public int size()
size in interface java.util.Map<K,V>size in class java.util.AbstractMap<K,V>public boolean isEmpty()
isEmpty in interface java.util.Map<K,V>isEmpty in class java.util.AbstractMap<K,V>public java.util.Iterator<K> iterator()
public java.util.Iterator<V> valueIterator()
public void putWait(K key,
V value)
key - value -
public V put(K key,
V value)
put in interface java.util.Map<K,V>put in class java.util.AbstractMap<K,V>key - value - public V getWait(K key)
key -
public V get(java.lang.Object key)
get in interface java.util.Map<K,V>get in class java.util.AbstractMap<K,V>key -
public void clear()
clear in interface java.util.Map<K,V>clear in class java.util.AbstractMap<K,V>public void terminate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||