Package | mx.charts.chartClasses |
Class | public class InstanceCache |
Inheritance | InstanceCache ![]() |
Property | Defined By | ||
---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
count : int
The number of items currently required in the cache.
| InstanceCache | ||
creationCallback : Function
A callback invoked when new instances are created.
| InstanceCache | ||
discard : Boolean = false
Determines if unneeded instances are discarded.
| InstanceCache | ||
factory : IFactory
A factory that generates the type of object to cache.
| InstanceCache | ||
format : TextFormat
A TextFormat to apply to any instances created.
| InstanceCache | ||
hide : Boolean = true
Determines if unneeded instances should be hidden.
| InstanceCache | ||
insertPosition : int
[write-only]
The position of the instance in the parent's child list.
| InstanceCache | ||
instances : Array
[read-only]
The Array of cached instances.
| InstanceCache | ||
properties : Object
A hashmap of properties to assign to new instances.
| InstanceCache | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
remove : Boolean = false
Determines if unneeded instances should be removed from their parent.
| InstanceCache |
Method | Defined By | ||
---|---|---|---|
Constructor.
| InstanceCache | ||
![]() |
Indicates whether an object has a specified property defined.
| Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
Returns the string representation of the specified object.
| Object | |
![]() |
Returns the primitive value of the specified object.
| Object |
count | property |
count:int
[read-write] The number of items currently required in the cache.
public function get count():int
public function set count(value:int):void
creationCallback | property |
public var creationCallback:Function
A callback invoked when new instances are created. This callback has the following signature:
function creationCallback(newInstance:Object, cache:InstanceCache):void;
discard | property |
public var discard:Boolean = false
Determines if unneeded instances are discarded.
If set to true
, extra elements are discarded
when the cache count is reduced.
Otherwise, extra elements are kept in a separate cache
and reused when the count is increased.
factory | property |
factory:IFactory
[read-write] A factory that generates the type of object to cache. Assigning to this discards all current instances and recreate new instances of the correct type.
public function get factory():IFactory
public function set factory(value:IFactory):void
format | property |
format:TextFormat
[read-write] A TextFormat to apply to any instances created. If set, this format is applied as the current and default format for the contents of any instances created. This property is only relevant if the factory generates TextField instances.
public function get format():TextFormat
public function set format(value:TextFormat):void
hide | property |
public var hide:Boolean = true
Determines if unneeded instances should be hidden.
If true
, the visible
property
is set to false
on each extra element
when the cache count is reduced, and set to true
when the count is increased.
This property is only relevant when the factory
generates DisplayObjects.
Setting this property to true
for other factory types
generates a run-time error.
insertPosition | property |
insertPosition:int
[write-only] The position of the instance in the parent's child list.
public function set insertPosition(value:int):void
instances | property |
instances:Array
[read-only]
The Array of cached instances.
There may be more instances in this Array than currently requested.
You should rely on the count
property
of the instance cache rather than the length of this Array.
public function get instances():Array
properties | property |
properties:Object
[read-write] A hashmap of properties to assign to new instances. Each key/value pair in this hashmap is assigned to each new instance created. The property hashmap is assigned to any existing instances when set.
The values in the hashmap are not cloned; object values are shared by all instances.
public function get properties():Object
public function set properties(value:Object):void
remove | property |
public var remove:Boolean = false
Determines if unneeded instances should be removed from their parent.
If true
, the removeChild()
method
is called on the parent for each extra element
when the cache count is reduced.
This property is only relevant when the factory
generates DisplayObjects.
Setting this property to true
for other factory types
generates a run-time error.
InstanceCache | () | Constructor |
public function InstanceCache(type:Object, parent:Object = null, insertPosition:int = -1)
Constructor.
Parameterstype:Object — The type of object to construct.
This can be either a Class or an IFactory.
|
|
parent:Object (default = null ) — An optional DisplayObject to add new instances to.
|
|
insertPosition:int (default = -1 ) — Where in the parent's child list
to insert instances. Set to -1 to add the children to the end of the child list.
|