alice.tuplemedium
Interface EventSet

All Known Implementing Classes:
EventSetImpl

public interface EventSet

Specifies the services which must be provided by component inside tuple centre virtual machine that manages communication events as a multiset

See Also:
Event, TupleCentreVM

Method Summary
 void add(Event e)
          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 e)
          Removes (if present) an event from multiset
 

Method Detail

add

public void add(Event e)
Adds an event to the multiset
Parameters:
e - the event to be added

sub

public void sub(Event e)
Removes (if present) an event from multiset
Parameters:
e - the event to be removed

isEmpty

public boolean isEmpty()
tests if multiset is empty
Returns:
true if the mset is empty, false if not

empty

public void empty()
Empties the multiset

size

public int size()
Gets the number of events inside the multiset
Returns:
the number of the events currently inside the multiset

get

public Event get()
Gets (with removal) not-deterministically an event from the mset
Returns:
the event removed

getFirstMatching

public Event getFirstMatching(TupleSet tset)
Gets (with removal) non-deterministically an event with a tuple template matching a tuple in the specified tuple set
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()
Gets an iterator to navigate through the elements of the multiset
Returns:
the iterator

removeEventsOf

public void removeEventsOf(AgentId id)
Removes all the events with a specified agent identifier
Parameters:
id - the agent identifier of the events to be removed