|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.util.DistHashTable
public class DistHashTable
Distributed version of a HashTable. Implemented with a SortedMap / TreeMap to keep the sequence order of elements.
Field Summary | |
---|---|
protected ChannelFactory |
cf
|
protected SocketChannel |
channel
|
protected edu.jas.util.DHTListener |
listener
|
protected java.util.SortedMap |
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. |
java.lang.Object |
get(java.lang.Object key)
Get value under key from DHT. |
java.util.ArrayList |
getArrayList()
Get the internal list, convert from Collection. |
java.util.SortedMap |
getList()
Get the internal sorted map. |
java.lang.Object |
getWait(java.lang.Object key)
Get value under key from DHT. |
boolean |
isEmpty()
Is the List empty? |
java.util.Iterator |
iterator()
List key iterator. |
java.util.Set |
keySet()
Get the keys as set. |
void |
put(java.lang.Object key,
java.lang.Object value)
Put object to the distributed hash table. |
void |
putWait(java.lang.Object key,
java.lang.Object value)
Put object to the distributed hash table. |
int |
size()
Size of the (local) list. |
void |
terminate()
Terminate the list thread. |
java.util.Iterator |
valueIterator()
List value iterator. |
java.util.Collection |
values()
Get the values as Collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.SortedMap theList
protected final ChannelFactory cf
protected SocketChannel channel
protected edu.jas.util.DHTListener 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 java.util.Collection values()
public java.util.Set keySet()
public java.util.ArrayList getArrayList()
public java.util.SortedMap getList()
public int size()
public boolean isEmpty()
public java.util.Iterator iterator()
public java.util.Iterator valueIterator()
public void putWait(java.lang.Object key, java.lang.Object value)
key
- value
- public void put(java.lang.Object key, java.lang.Object value)
key
- value
- public java.lang.Object getWait(java.lang.Object key)
key
-
public java.lang.Object get(java.lang.Object key)
key
-
public void clear()
public void terminate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |