alice.respect
Class EventSetImpl

java.lang.Object
  |
  +--alice.respect.EventSetImpl
All Implemented Interfaces:
EventSet

public class EventSetImpl
extends java.lang.Object
implements EventSet

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


Constructor Summary
EventSetImpl()
           
 
Method Summary
 void add(Event t)
          Adds an event to the multiset
 void empty()
          Empties the multiset
 Event get()
          Gets (with removal) not-deterministically an event from the mset
 Event getFirstMatching(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(AgentId id)
          Removes all the events with a specified agent identifier
 int size()
          Gets the number of events inside the multiset
 void sub(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
 

Constructor Detail

EventSetImpl

public EventSetImpl()
Method Detail

add

public void add(Event t)
Description copied from interface: EventSet
Adds an event to the multiset
Specified by:
add in interface EventSet
Following copied from interface: alice.tuplemedium.EventSet
Parameters:
e - the event to be added

sub

public void sub(Event t)
Description copied from interface: EventSet
Removes (if present) an event from multiset
Specified by:
sub in interface EventSet
Following copied from interface: alice.tuplemedium.EventSet
Parameters:
e - the event to be removed

isEmpty

public boolean isEmpty()
Description copied from interface: EventSet
tests if multiset is empty
Specified by:
isEmpty in interface EventSet
Following copied from interface: alice.tuplemedium.EventSet
Returns:
true if the mset is empty, false if not

empty

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

size

public int size()
Description copied from interface: EventSet
Gets the number of events inside the multiset
Specified by:
size in interface EventSet
Following copied from interface: alice.tuplemedium.EventSet
Returns:
the number of the events currently inside the multiset

get

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

getFirstMatching

public Event getFirstMatching(TupleSet tset)
Description copied from interface: 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 EventSet
Following copied from interface: alice.tuplemedium.EventSet
Parameters:
tset - the tuple set with tuples to be matched
Returns:
an event of the mset matching a tuple, null if nothing found

getIterator

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

removeEventsOf

public void removeEventsOf(AgentId id)
Description copied from interface: EventSet
Removes all the events with a specified agent identifier
Specified by:
removeEventsOf in interface EventSet
Following copied from interface: alice.tuplemedium.EventSet
Parameters:
id - the agent identifier of the events to be removed