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

Quick Search    Search Deep

alice.respect
Class EventSetImpl  view EventSetImpl download EventSetImpl.java

java.lang.Object
  extended byalice.respect.EventSetImpl
All Implemented Interfaces:
alice.tuplemedium.EventSet

public class EventSetImpl
extends java.lang.Object
implements alice.tuplemedium.EventSet

Naive implementation of the EventSet interface, defining the behaviour of the component managin vm events storage.


Field Summary
private  java.util.ArrayList events
           
private  java.util.Random rand
           
 
Constructor Summary
EventSetImpl()
           
 
Method Summary
 void add(alice.tuplemedium.Event t)
          Adds an event to the multiset
 void empty()
          Empties the multiset
 alice.tuplemedium.Event get()
          Gets (with removal) not-deterministically an event from the mset
 alice.tuplemedium.Event getFirstMatching(alice.tuplemedium.TupleSet tset)
          Gets (with removal) non-deterministically an event with a tuple template matching a tuple in the specified tuple set
 java.util.Iterator getIterator()
          Gets an iterator to navigate through the elements of the multiset
 boolean isEmpty()
          tests if multiset is empty
 void removeEventsOf(alice.tuplemedium.AgentId id)
          Removes all the events with a specified agent identifier
 int size()
          Gets the number of events inside the multiset
 void sub(alice.tuplemedium.Event t)
          Removes (if present) an event from multiset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

events

private java.util.ArrayList events

rand

private java.util.Random rand
Constructor Detail

EventSetImpl

public EventSetImpl()
Method Detail

add

public void add(alice.tuplemedium.Event t)
Description copied from interface: alice.tuplemedium.EventSet
Adds an event to the multiset

Specified by:
add in interface alice.tuplemedium.EventSet

sub

public void sub(alice.tuplemedium.Event t)
Description copied from interface: alice.tuplemedium.EventSet
Removes (if present) an event from multiset

Specified by:
sub in interface alice.tuplemedium.EventSet

isEmpty

public boolean isEmpty()
Description copied from interface: alice.tuplemedium.EventSet
tests if multiset is empty

Specified by:
isEmpty in interface alice.tuplemedium.EventSet

empty

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

Specified by:
empty in interface alice.tuplemedium.EventSet

size

public int size()
Description copied from interface: alice.tuplemedium.EventSet
Gets the number of events inside the multiset

Specified by:
size in interface alice.tuplemedium.EventSet

get

public alice.tuplemedium.Event get()
Description copied from interface: alice.tuplemedium.EventSet
Gets (with removal) not-deterministically an event from the mset

Specified by:
get in interface alice.tuplemedium.EventSet

getFirstMatching

public alice.tuplemedium.Event getFirstMatching(alice.tuplemedium.TupleSet tset)
Description copied from interface: alice.tuplemedium.EventSet
Gets (with removal) non-deterministically an event with a tuple template matching a tuple in the specified tuple set

Specified by:
getFirstMatching in interface alice.tuplemedium.EventSet

getIterator

public java.util.Iterator getIterator()
Description copied from interface: alice.tuplemedium.EventSet
Gets an iterator to navigate through the elements of the multiset

Specified by:
getIterator in interface alice.tuplemedium.EventSet

removeEventsOf

public void removeEventsOf(alice.tuplemedium.AgentId id)
Description copied from interface: alice.tuplemedium.EventSet
Removes all the events with a specified agent identifier

Specified by:
removeEventsOf in interface alice.tuplemedium.EventSet