alice.respect
Class TRSetImpl

java.lang.Object
  |
  +--alice.respect.TRSetImpl
All Implemented Interfaces:
TRSet

public class TRSetImpl
extends java.lang.Object
implements TRSet

Naive implementation of the TRSet interface, defining the behaviour of the component that manages triggered reactions.


Constructor Summary
TRSetImpl()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TRSetImpl

public TRSetImpl()
Method Detail

add

public void add(TriggeredReaction t)
Description copied from interface: TRSet
Adds a triggered reaction to the multiset
Specified by:
add in interface TRSet
Following copied from interface: alice.tuplemedium.TRSet
Parameters:
t - the triggered reaction to be added

sub

public void sub(TriggeredReaction t)
Description copied from interface: TRSet
Removes a triggered reaction from the multiset
Specified by:
sub in interface TRSet
Following copied from interface: alice.tuplemedium.TRSet
Parameters:
t - the triggered reaction to be removed

isEmpty

public boolean isEmpty()
Description copied from interface: TRSet
Tests if the multiset is empty
Specified by:
isEmpty in interface TRSet

empty

public void empty()
Description copied from interface: TRSet
Empties the multiset
Specified by:
empty in interface TRSet

get

public TriggeredReaction get()
Description copied from interface: TRSet
Gets not-deterministically (with removal) a triggered reaction from the multiset
Specified by:
get in interface TRSet
Following copied from interface: alice.tuplemedium.TRSet
Returns:
the triggered reaction removed

getIterator

public java.util.Iterator getIterator()
Description copied from interface: TRSet
Gets an iterator to navigate through triggered reactions
Specified by:
getIterator in interface TRSet
Following copied from interface: alice.tuplemedium.TRSet
Returns:
the iterator

beginTransaction

public void beginTransaction()
Description copied from interface: TRSet
Begins a transaction section Every operation on multiset can be undone
Specified by:
beginTransaction in interface TRSet

endTransaction

public void endTransaction(boolean commit)
Description copied from interface: TRSet
Ends a transaction section specifying if operations must be committed or undone
Specified by:
endTransaction in interface TRSet
Following copied from interface: alice.tuplemedium.TRSet
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