public abstract class Action extends Object implements Event
An action may embed several other events. Events are attach to the actions
using Action.Hook
.
hook.
Modifier and Type | Class and Description |
---|---|
static class |
Action.Hook
Possible moments where an event can be considered.
|
Constructor and Description |
---|
Action(int st,
int ed)
Create an action.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEvent(Action.Hook k,
Event n)
Add an event to the action.
|
boolean |
apply(Model i)
Apply the action on a model.
|
abstract boolean |
applyAction(Model i)
Apply only the scheduled action.
|
boolean |
applyEvents(Action.Hook k,
Model i)
Apply the events attached to a given hook.
|
boolean |
equals(Object o) |
int |
getEnd()
Get the moment the action ends.
|
Set<Event> |
getEvents(Action.Hook k)
Get the events attached to a specific hook.
|
int |
getStart()
Get the moment the action starts.
|
int |
hashCode() |
abstract String |
pretty()
Pretty print of the action.
|
String |
toString() |
public Action(int st, int ed)
st
- the moment the action startsed
- the moment the action endspublic boolean apply(Model i)
Action.Hook.PRE
are executed in first,
then applyAction(org.btrplace.model.Model)
is called. Finally,
the events attached to Action.Hook.POST
are executed.public boolean applyEvents(Action.Hook k, Model i)
k
- the hooki
- the model to modify with the application of the eventstrue
iff all the events were applied successfullypublic abstract boolean applyAction(Model i)
i
- the model to modifytrue
if the action was applied successfullypublic int getStart()
public int getEnd()
public boolean addEvent(Action.Hook k, Event n)
k
- the hookn
- the event to attachtrue
iff the event was addedpublic Set<Event> getEvents(Action.Hook k)
k
- the hookpublic abstract String pretty()
Copyright © 2015 University of Nice-Sophia Antipolis. All Rights Reserved.