Accessor
| Kind of class: | public interface |
|---|---|
| Package: | com.bourre.core |
| Inherits from: | none |
| Implemented by: | |
| Author: | Cédric Néhémie |
| Classpath: | com.bourre.core.Accessor |
| File last modified: | Saturday, 19 January 2008, 10:10:26 |
The
to create abstract access to properties or methods of an
object. That interface allow tweens to get and set both
properties and methods of an object in a transparent way.
Accessor interface defines common rulesto create abstract access to properties or methods of an
object. That interface allow tweens to get and set both
properties and methods of an object in a transparent way.
An Accessor could access to only one property or
getter/setter pair of methods for an object. To access many
properties/methods in one time see the AccessorComposerinterface.
In order to the accessor to get or set value with methods, an accessor
must know both getter and setter methods name. If one of these information
is not available, the accessor must throw an exception in order to prevent
the tween to work on unavailable data.
There isn't any method to dynamically bind an accessor to a new property or
a new getter/setter pair of method. You have to create a new accessor if you
need to change the property you want to access.
Note : Of course, only public members of the target object could be accessed
by an accessor instance.
See also:
- AccessorComposer
- com.bourre.transitions.AbstractTween
Summary
Instance methods
- getValue : Number
- Retreives the value from the target property.
- setValue (value:Number) : void
- Defines the new value for the target property.
- getTarget : Object
- Returns the target object onto which this accessor
- getGetterHelper : String
- Returns the string name of the getter access used
- getSetterHelper : String
- Returns the string name of the setter access used
Instance methods
getGetterHelper
public function getGetterHelper (
) : String
Returns the string name of the getter access used
by this accessor to retreive data from its target
object.
by this accessor to retreive data from its target
object.
Returns:
- the string name of the getter access used
by this accessor
getSetterHelper
public function getSetterHelper (
) : String
Returns the string name of the setter access used
by this accessor to defines new data to its target
object.
by this accessor to defines new data to its target
object.
Returns:
- the string name of the setter access used
by this accessor
getTarget
public function getTarget (
) : Object
Returns the target object onto which this accessor
operate.
operate.
Returns:
- the object onto which this accessor operate
getValue
public function getValue (
) : Number
Retreives the value from the target property.
If the type of the data stored by this object is not
a number type, the call must fail with an exception.
If the type of the data stored by this object is not
a number type, the call must fail with an exception.
Returns:
- current value stored in the target property
Throws:
- {VISDOC_LINK_0}
ClassCastException— The target property
doesn't store a number.
setValue
public function setValue (
value:Number) : void
Defines the new value for the target property.
If the type of the data stored by this object is not
a number type, the call must fail with an exception.
If the type of the data stored by this object is not
a number type, the call must fail with an exception.
Parameters:
value:
new numeric value for the target property
Throws:
- {VISDOC_LINK_0}
ClassCastException— The target property
doesn't store a number.