|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.util.DistributedList
public class DistributedList
Distributed version of a List. Implemented with a SortedMap / TreeMap to keep the sequence order of elements.
Field Summary | |
---|---|
protected ChannelFactory |
cf
|
protected SocketChannel |
channel
|
protected edu.jas.util.Listener |
listener
|
protected java.util.SortedMap<edu.jas.util.Counter,java.lang.Object> |
theList
|
Constructor Summary | |
---|---|
DistributedList(ChannelFactory cf,
java.lang.String host,
int port)
Constructor for DistributedList. |
|
DistributedList(SocketChannel sc)
Constructor for DistributedList. |
|
DistributedList(java.lang.String host)
Constructor for DistributedList. |
|
DistributedList(java.lang.String host,
int port)
Constructor for DistributedList. |
Method Summary | |
---|---|
void |
add(java.lang.Object o)
Add object to the list and distribute to other lists. |
void |
clear()
Clear the List. |
java.util.List<java.lang.Object> |
getList()
Get the internal list, convert from Collection. |
boolean |
isEmpty()
Is the List empty? |
java.util.Iterator |
iterator()
List iterator. |
int |
size()
Size of the (local) list. |
void |
terminate()
Terminate the list thread. |
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<edu.jas.util.Counter,java.lang.Object> theList
protected final ChannelFactory cf
protected SocketChannel channel
protected edu.jas.util.Listener listener
Constructor Detail |
---|
public DistributedList(java.lang.String host)
host
- name or IP of server host.public DistributedList(java.lang.String host, int port)
host
- name or IP of server host.port
- of server.public DistributedList(ChannelFactory cf, java.lang.String host, int port)
cf
- ChannelFactory to use.host
- name or IP of server host.port
- of server.public DistributedList(SocketChannel sc)
sc
- SocketChannel to use.Method Detail |
---|
public java.util.List<java.lang.Object> getList()
public int size()
public void add(java.lang.Object o)
o
- public void terminate()
public void clear()
public boolean isEmpty()
public java.util.Iterator iterator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |