alice.tuplemedium
Interface TRSet

All Known Implementing Classes:
TRSetImpl

public interface TRSet

Specifies the services which must be provided by the component inside the tuple centre virtual machine collecting and managing triggered reactions as a multiset An important aspect of the component implementing this interface is the ability to execute transactions, that is execute sequence of operations that could be commited or asked to be undone.

See Also:
TriggeredReaction, Reaction, Reactor, TupleCentreVM

Method Summary
 void add(TriggeredReaction t)
          Adds a triggered reaction to the multiset
 void beginTransaction()
          Begins a transaction section Every operation on multiset can be undone
 void empty()
          Empties the multiset
 void endTransaction(boolean commit)
          Ends a transaction section specifying if operations must be committed or undone
 TriggeredReaction get()
          Gets not-deterministically (with removal) a triggered reaction from the multiset
 java.util.Iterator getIterator()
          Gets an iterator to navigate through triggered reactions
 boolean isEmpty()
          Tests if the multiset is empty
 void sub(TriggeredReaction t)
          Removes a triggered reaction from the multiset
 

Method Detail

add

public void add(TriggeredReaction t)
Adds a triggered reaction to the multiset
Parameters:
t - the triggered reaction to be added

sub

public void sub(TriggeredReaction t)
Removes a triggered reaction from the multiset
Parameters:
t - the triggered reaction to be removed

isEmpty

public boolean isEmpty()
Tests if the multiset is empty

empty

public void empty()
Empties the multiset

beginTransaction

public void beginTransaction()
Begins a transaction section Every operation on multiset can be undone

endTransaction

public void endTransaction(boolean commit)
Ends a transaction section specifying if operations must be committed or undone
Parameters:
commit - if true the operations are committed, else they are undone and the multiset is rolled back to the state before the beginTransaction invocation

get

public TriggeredReaction get()
Gets not-deterministically (with removal) a triggered reaction from the multiset
Returns:
the triggered reaction removed

getIterator

public java.util.Iterator getIterator()
Gets an iterator to navigate through triggered reactions
Returns:
the iterator