|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgrinda.impl.tuplespace.DynamicContainer
public class DynamicContainer
A tuple container that dynamically choose the bset container to use
Constructor Summary | |
---|---|
DynamicContainer(InternalTuple absoluteTemplate)
|
Method Summary | |
---|---|
void |
add(InternalTuple t)
Adds an InternalTuple to the container |
boolean |
isEmpty()
Checks if the container is empty |
InternalTuple |
lookup(InternalTuple pattern)
Looks up a tuples that match the given template using the associative matching |
InternalTuple[] |
lookupAll(InternalTuple pattern)
Looks up all the tuples that match the given template using the associative matching |
protected void |
readLock()
Blocks reader if there are other writer active |
protected void |
readUnlock()
removes the read lock |
InternalTuple |
remove(InternalTuple pattern)
Removes a the tuple that match the given template using the associative matching |
InternalTuple[] |
removeAll(InternalTuple pattern)
Removes all the tuples that match the given template using the associative matching |
int |
size()
Gets the number of tuple stored |
java.util.Collection |
tuples()
Gets a collection of all the tuple stored |
void |
writeLock()
Blocks writer if there are readers or another writer active |
void |
writeUnlock()
Removes the write lock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynamicContainer(InternalTuple absoluteTemplate)
Method Detail |
---|
public void add(InternalTuple t)
add
in interface TupleContainer
t
- the tuplepublic InternalTuple[] lookupAll(InternalTuple pattern)
lookupAll
in interface TupleContainer
pattern
- the template
public InternalTuple lookup(InternalTuple pattern)
lookup
in interface TupleContainer
pattern
- the template
public InternalTuple remove(InternalTuple pattern)
remove
in interface TupleContainer
pattern
- the template
public InternalTuple[] removeAll(InternalTuple pattern)
removeAll
in interface TupleContainer
pattern
- the template
public int size()
size
in interface TupleContainer
public boolean isEmpty()
isEmpty
in interface TupleContainer
public java.util.Collection tuples()
tuples
in interface TupleContainer
public void writeLock()
public void writeUnlock()
protected void readLock()
protected void readUnlock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |