lights.adapters.tspaces201
Class TupleSpaceAdapter
java.lang.Object
|
+--lights.adapters.tspaces201.TupleSpaceAdapter
- public class TupleSpaceAdapter
- extends java.lang.Object
- implements ITupleSpace
Method Summary |
int |
count(ITuple template)
Returns a count of the tuples found in the tuple space that match the
template. |
java.lang.String |
getName()
Returns the name of the tuple space. |
ITuple |
in(ITuple template)
Withdraws from the tuple space a tuple matching the template
specified. |
ITuple[] |
ing(ITuple template)
Withdraws from the tuple space all the tuple matching the template
specified. |
ITuple |
inp(ITuple template)
Withdraws from the tuple space a tuple matching the template
specified. |
void |
out(ITuple tuple)
Inserts a tuple in the tuple space. |
void |
outg(ITuple[] tuples)
Inserts multiple tuples in the tuple space. |
ITuple |
rd(ITuple template)
Reads from the tuple space a copy of a tuple matching the template
specified. |
ITuple[] |
rdg(ITuple template)
Reads from the tuple space a copy of all the tuples matching the
template specified. |
ITuple |
rdp(ITuple template)
Reads from the tuple space a copy of a tuple matching the template
specified. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
TupleSpaceAdapter
public TupleSpaceAdapter(java.lang.String name)
throws TupleSpaceException
getName
public java.lang.String getName()
- Description copied from interface: ITupleSpace
- Returns the name of the tuple space.
- Specified by:
- getName in interface ITupleSpace
out
public void out(ITuple tuple)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Inserts a tuple in the tuple space. Note how different implementations
may specify different atomicity requirements.
- Specified by:
- out in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
tuple
- The tuple to be inserted.- Throws:
- TupleSpaceException - if an error occurs in the implementation.
outg
public void outg(ITuple[] tuples)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Inserts multiple tuples in the tuple space. Note how different
implementations may specify different atomicity requirements.
- Specified by:
- outg in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
tuples
- An array containing the tuples to be inserted.- Throws:
- TupleSpaceException - if an error occurs in the
implementation.
in
public ITuple in(ITuple template)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Withdraws from the tuple space a tuple matching the template
specified. If no tuple is found, the caller is suspended until such a
tuple shows up in the tuple space. Note how different implementations
may specify different policies for the selection of the tuple returned
among multiple matches.
- Specified by:
- in in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
template
- the template used for matching.- Returns:
- a tuple matching the template.
- Throws:
- TupleSpaceException - if an error in the implementation.
inp
public ITuple inp(ITuple template)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Withdraws from the tuple space a tuple matching the template
specified. If no tuple is found,
null
is returned. Note how
different implementations may specify different policies for the
selection of the tuple returned among multiple matches.
- Specified by:
- inp in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
template
- the template used for matching.- Returns:
- a tuple matching the template, or
null
if none is
found. - Throws:
- TupleSpaceException - if an error in the implementation.
ing
public ITuple[] ing(ITuple template)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Withdraws from the tuple space all the tuple matching the template
specified. If no tuple is found,
null
is returned.
- Specified by:
- ing in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
template
- the template used for matching.- Returns:
- a tuple matching the template, or
null
if none is
found. - Throws:
- TupleSpaceException - if an error in the implementation.
rd
public ITuple rd(ITuple template)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Reads from the tuple space a copy of a tuple matching the template
specified. If no tuple is found, the caller is suspended until such a
tuple shows up in the tuple space. Note how different implementations may
specify different policies for the selection of the tuple returned among
multiple matches.
- Specified by:
- rd in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
template
- the template used for matching.- Returns:
- a copy of a tuple matching the template.
- Throws:
- TupleSpaceException - if an error in the implementation.
rdp
public ITuple rdp(ITuple template)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Reads from the tuple space a copy of a tuple matching the template
specified. If no tuple is found,
null
is returned. Note how
different implementations may specify different policies for the
selection of the tuple returned among multiple matches.
- Specified by:
- rdp in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
template
- the template used for matching.- Returns:
- a copy of a tuple matching the template.
- Throws:
- TupleSpaceException - if an error in the implementation.
rdg
public ITuple[] rdg(ITuple template)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Reads from the tuple space a copy of all the tuples matching the
template specified. If no tuple is found,
null
is returned.\
- Specified by:
- rdg in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
template
- the template used for matching.- Returns:
- a copy of a tuple matching the template.
- Throws:
- TupleSpaceException - if an error in the implementation.
count
public int count(ITuple template)
throws TupleSpaceException
- Description copied from interface: ITupleSpace
- Returns a count of the tuples found in the tuple space that match the
template.
- Specified by:
- count in interface ITupleSpace
- Tags copied from interface: ITupleSpace
- Parameters:
template
- the template used for matching.- Returns:
- the number of tuples currently in the tuple space that match the
template.
- Throws:
- TupleSpaceException - if an error in the implementation.