Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

alice.respect
Class TRSetImpl  view TRSetImpl download TRSetImpl.java

java.lang.Object
  extended byalice.respect.TRSetImpl
All Implemented Interfaces:
alice.tuplemedium.TRSet

public class TRSetImpl
extends java.lang.Object
implements alice.tuplemedium.TRSet

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


Field Summary
private  java.util.Random rand
           
private  java.util.ArrayList tAdded
           
private  boolean transaction
           
private  java.util.ArrayList tRemoved
           
private  java.util.ArrayList trigs
           
 
Constructor Summary
TRSetImpl()
           
 
Method Summary
 void add(alice.tuplemedium.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
 alice.tuplemedium.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(alice.tuplemedium.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
 

Field Detail

trigs

private java.util.ArrayList trigs

tAdded

private java.util.ArrayList tAdded

tRemoved

private java.util.ArrayList tRemoved

transaction

private boolean transaction

rand

private java.util.Random rand
Constructor Detail

TRSetImpl

public TRSetImpl()
Method Detail

add

public void add(alice.tuplemedium.TriggeredReaction t)
Description copied from interface: alice.tuplemedium.TRSet
Adds a triggered reaction to the multiset

Specified by:
add in interface alice.tuplemedium.TRSet

sub

public void sub(alice.tuplemedium.TriggeredReaction t)
Description copied from interface: alice.tuplemedium.TRSet
Removes a triggered reaction from the multiset

Specified by:
sub in interface alice.tuplemedium.TRSet

isEmpty

public boolean isEmpty()
Description copied from interface: alice.tuplemedium.TRSet
Tests if the multiset is empty

Specified by:
isEmpty in interface alice.tuplemedium.TRSet

empty

public void empty()
Description copied from interface: alice.tuplemedium.TRSet
Empties the multiset

Specified by:
empty in interface alice.tuplemedium.TRSet

get

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

Specified by:
get in interface alice.tuplemedium.TRSet

getIterator

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

Specified by:
getIterator in interface alice.tuplemedium.TRSet

beginTransaction

public void beginTransaction()
Description copied from interface: alice.tuplemedium.TRSet
Begins a transaction section Every operation on multiset can be undone

Specified by:
beginTransaction in interface alice.tuplemedium.TRSet

endTransaction

public void endTransaction(boolean commit)
Description copied from interface: alice.tuplemedium.TRSet
Ends a transaction section specifying if operations must be committed or undone

Specified by:
endTransaction in interface alice.tuplemedium.TRSet