public class EventList
extends java.lang.Object
Constructor and Description |
---|
EventList()
Default constructor.
|
EventList(java.util.Set<Event> events)
Constructs object with the specified events collection.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Event event)
Adds event.
|
void |
addEvents(java.util.Collection<? extends Event> events)
Adds a collection of events.
|
void |
applyToEventList(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Applies expressions to bounded event variables.
|
void |
clear()
Removes all the internal events.
|
boolean |
compatibleWith(EventList eventList)
Checks if this object is compatible with the specified one.
|
boolean |
contains(Event event)
Checks rather this object contains the specified event.
|
boolean |
contains(ru.ispras.fortress.expression.NodeVariable variable)
Checks rather this object contains an event on the specified variable.
|
EventList |
deepCopy()
Returns a deep copy of this object.
|
boolean |
equals(java.lang.Object obj) |
java.util.Collection<Event> |
getEvents()
Returns a collection of events.
|
int |
hashCode() |
boolean |
isEmpty()
Checks if this object is empty.
|
boolean |
isTriggered(Event event)
Checks if this object is always triggered along with the specified argument.
|
void |
remove(RangedVariable variable)
Removes an event on the specified variable.
|
java.lang.String |
toString() |
public EventList()
public EventList(java.util.Set<Event> events)
events
- events collectionjava.lang.IllegalArgumentException
- when argument is null
.public boolean contains(Event event)
event
- event objecttrue
if event is here, false
otherwisejava.lang.IllegalArgumentException
- when argument is null
.public boolean contains(ru.ispras.fortress.expression.NodeVariable variable)
variable
- variable of an event of the object to be checkedtrue
if object contains an event with the specified variable,
false
otherwisejava.lang.IllegalArgumentException
- when argument is null
.public void add(Event event)
If this object already contains an event with the same
RangedVariable
as the specified
Event
has, but their
EventType
types are different,
the Event
object with the same
RangedVariable
and
EventType.ANY_EDGE
event type.
event
- event objectjava.lang.IllegalArgumentException
- when argument is null
.public void remove(RangedVariable variable)
variable
- event's variablejava.lang.IllegalArgumentException
- when argument is null
.public void addEvents(java.util.Collection<? extends Event> events)
events
- event collectionjava.lang.IllegalArgumentException
- when argument is null
.public boolean isEmpty()
true
if this event list doesn't contain any events, false
otherwise.public java.util.Collection<Event> getEvents()
public void applyToEventList(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
bindings
- "event's variable name - bounded expression" mapjava.lang.IllegalArgumentException
- when argument is null
.public boolean compatibleWith(EventList eventList)
Checks if this object and the specified object are not mutually exclusive.
eventList
- the event list to be tested for compatibility with this onetrue
if the lists are compatible, otherwise returns false
Event.isCompatible(Event)
public boolean isTriggered(Event event)
Checks if this object is triggered by the specified Event
object, for example,
if this event is any edge of some variable while other is positive edge of the same variable.
To trigger this object it is necessary and sufficient to trigger at least one of its
events.
event
- the event to be testedtrue
if this event is always triggered along with the specified one,
false
otherwise.public EventList deepCopy()
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object