|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.co.badgersinfoil.jactionscript.ActionList
An ActionList declares a list of actionscript bytecodes, in execution
order. The list doesn't store Action
objects directly, they are
referred to indirectly via an ActionHandle
object. This extra level
of indirection allows the list to manage the targets of branch operations
in the face of insertions or deletions (branch operations keep a reference
to the ActionHandle of their target, rather then the target Action itself, or
an integer offset into the list). ActionHandle objects form a doubly-linked
list that should be managed though calls to the ActionList that owns them.
Insertion of actions into the middle of the list isn't implemented yet. Sorry.
Constructor Summary | |
ActionList()
|
Method Summary | |
void |
accept(Visitor v)
|
ActionHandle |
append(Action op)
|
ActionHandle |
first()
Returns the handle on the first Action in the list |
ActionHandle |
get(int pos)
|
ActionHandle |
last()
Returns the handle on the last Action in the list |
int |
length()
|
ActionHandle |
peekNext()
Returns a reference to the object that will be returned by the next call to append(Action) . |
void |
pokeNext(ActionHandle handle)
Set the ActionHandle for the next Action appended. |
void |
remove(ActionHandle handle)
Removes the Action referenced by the given handle from this list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ActionList()
Method Detail |
public ActionHandle append(Action op)
public ActionHandle peekNext()
append(Action)
.
public void pokeNext(ActionHandle handle)
ActionHandle target = new ActionHandle(); list.append(new IfJumpAction(target)); ..more appends.. list.pokeNext(target); list.append(..the target Action..);
public void accept(Visitor v) throws JASVisitorException
JASVisitorException
public int length()
public ActionHandle first()
public ActionHandle last()
public ActionHandle get(int pos)
java.lang.IllegalArgumentException
- if pos if less than 0, or beond
the end of the listpublic void remove(ActionHandle handle)
BranchAction
objects,
those branches will be re-targeted at the next ActionHandle in the
list (or the handle given by peekNext()
if you are removing
the last item in the list).
Trying to remove a handle not in this list will result in undefined behaviour.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |