|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.action.NewFunction
public final class NewFunction
The NewFunction action is used to create a user-defined function.
User-defined functions are also used to create methods for user-defined objects. The name of the function is omitted and the function definition is assigned to a variable which allows it to be referenced at a later time.
In the actions which form the function body all the arguments passed to the function can be referenced by the name supplied in the arguments list.
All the action objects created are owned by the function. They will be deleted when the function definition is deleted.
NewFunction2| Nested Class Summary | |
|---|---|
static class |
NewFunction.Builder
The Builder class is used to generate a new NewFunction object using a small set of convenience methods. |
| Constructor Summary | |
|---|---|
NewFunction(List<String> argumentArray,
List<Action> actionArray)
Creates a anonymous NewFunction with the specified argument names and actions to be executed. |
|
NewFunction(NewFunction.Builder builder)
Creates and initialises a NewFunction object using parameters defined in the Builder. |
|
NewFunction(NewFunction object)
Creates and initialises a NewFunction action using the values copied from another NewFunction action. |
|
NewFunction(String aString,
List<String> argumentArray,
List<Action> actionArray)
Creates a NewFunction with the specified name, argument names and actions to be executed. |
|
NewFunction(SWFDecoder coder,
Context context)
Creates and initialises a NewFunction definition using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
NewFunction |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
List<Action> |
getActions()
Get the actions that will be executed. |
List<String> |
getArguments()
Get the names of the function arguments. |
String |
getName()
Get the name of the function. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NewFunction(NewFunction.Builder builder)
builder - a Builder object containing the parameters to generate
the function definition.
public NewFunction(SWFDecoder coder,
Context context)
throws IOException
coder - an SWFDecoder object that contains the encoded Flash data.context - a Context object used to manage the decoders for different
type of object and to pass information on how objects are
decoded.
IOException - if an error occurs while decoding the data.
public NewFunction(String aString,
List<String> argumentArray,
List<Action> actionArray)
aString - the name of the function. May not be null.argumentArray - the list of Strings giving the names of the arguments.actionArray - the list of actions that define the operation performed by
the function.
public NewFunction(List<String> argumentArray,
List<Action> actionArray)
argumentArray - a list of Strings giving the names of the arguments.actionArray - a list of actions that define the operation performed by
the function.public NewFunction(NewFunction object)
object - a NewFunction action from which the values will be
copied. References to immutable objects will be shared.| Method Detail |
|---|
public String getName()
public List<String> getArguments()
public List<Action> getActions()
public NewFunction copy()
copy in interface Copyable<Action>public String toString()
toString in class Objectpublic int prepareToEncode(Context context)
prepareToEncode in interface SWFEncodeablecontext - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder,
Context context)
throws IOException
encode in interface SWFEncodeablecoder - an SWFEncoder object.context - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException - if an error occurs while encoding the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||