Packagevegas.models.collections
Classpublic class CollectionModelObject
InheritanceCollectionModelObject Inheritance CoreModelObject Inheritance CoreModel Inheritance CoreEventDispatcher Inheritance Object
Subclasses SetModelObject

This model use an internal Collection to register value objects.



Public Properties
 PropertyDefined By
 Inheritedchannel : String
[read-only] Indicates the channel of this dispatcher if this instance is global.
CoreEventDispatcher
 Inheritedid : *
Returns the id of this IModelObject.
CoreModel
 Inheritedsecurity : Boolean = true
This property defined if the setCurrentVO method can accept the same vo in argument as the current one.
CoreModelObject
Public Methods
 MethodDefined By
  
CollectionModelObject(global:Boolean = true, channel:String = null, id:* = null)
Creates a new CollectionModelObject instance.
CollectionModelObject
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target.
CoreEventDispatcher
  
addVO(vo:ValueObject):Boolean
Inserts a value object in the model.
CollectionModelObject
  
clear():void
[override] Removes all value objects in the model.
CollectionModelObject
  
contains(vo:ValueObject):Boolean
Returns true if the model contains the specified ValueObject.
CollectionModelObject
  
containsByProperty(propName:String, value:*):Boolean
Returns true if the model contains the specified attribute value.
CollectionModelObject
 Inherited
Returns and creates a new empty ModelObjectEvent.
CoreModelObject
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
CoreEventDispatcher
  
Returns the internal Collection of this model.
CollectionModelObject
 Inherited
Returns the current ValueObject selected in this model.
CoreModelObject
 Inherited
Returns the internal system.events.EventDispatcher reference.
CoreEventDispatcher
  
Returns the event name use in the addVO method.
CollectionModelObject
 Inherited
Returns the event name use in the setCurrentVO method before is changed.
CoreModelObject
 Inherited
Returns the event name use in the setVO method.
CoreModelObject
 Inherited
Returns the event name use in the clear method.
CoreModelObject
  
Returns the event name use in the removeVO method.
CollectionModelObject
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
CoreEventDispatcher
  
[override] This method is invoked in the constructor of the class to initialize all events.
CollectionModelObject
  
Initialize the internal Collection instance in the constructor of the class.
CollectionModelObject
  
isEmpty():Boolean
Returns {
CollectionModelObject
 Inherited
isGlobal():Boolean
Indicates if the dispatcher use a global event flow.
CoreEventDispatcher
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreEventDispatcher
  
Returns the iterator of this model.
CollectionModelObject
 Inherited
lock():void
Locks the object.
CoreEventDispatcher
  
Notify a ModelObjectEvent when a ValueObject is inserted in the model.
CollectionModelObject
 Inherited
Notify a ModelObjectEvent before the current ValueObject selected in the model is changed.
CoreModelObject
 Inherited
Notify a ModelObjectEvent when a ValueObject change in the model.
CoreModelObject
 Inherited
Notify a ModelObjectEvent when the model is cleared.
CoreModelObject
  
Notify a ModelObjectEvent when a ValueObject is removed in the model.
CollectionModelObject
 Inherited
registerEventListener(type:String, listener:*, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target (Function or EventListener).
CoreEventDispatcher
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
CoreEventDispatcher
  
Removes a value object in the model.
CollectionModelObject
 Inherited
run(... arguments):void
Run the first process with this model.
CoreModel
  
Sets the internal Collection of this model.
CollectionModelObject
 Inherited
Sets the current ValueObject selected in this model.
CoreModelObject
 Inherited
Sets the internal EventDispatcher reference.
CoreEventDispatcher
  
setEventTypeADD(type:String):void
Sets the event name use in the addVO method.
CollectionModelObject
 Inherited
setEventTypeBEFORE_CHANGE(type:String):void
Returns the event name use in the setCurrentVO method before is changed.
CoreModelObject
 Inherited
setEventTypeCHANGE(type:String):void
Returns the event name use in the setVO method.
CoreModelObject
 Inherited
setEventTypeCLEAR(type:String):void
Returns the event name use in the clear method.
CoreModelObject
  
setEventTypeREMOVE(type:String):void
Sets the event name use in the removeVO method.
CollectionModelObject
 Inherited
setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global system.events.EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher.
CoreEventDispatcher
  
size():Number
Returns the number of ValueObject in this model.
CollectionModelObject
 Inherited
supports(value:*):Boolean
Returns true if the IValidator object validate the value.
CoreModelObject
  
toArray():Array
Returns the Array representation of this object.
CollectionModelObject
 Inherited
unlock():void
Unlocks the display.
CoreEventDispatcher
 Inherited
unregisterEventListener(type:String, listener:*, useCapture:Boolean = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object.
CoreEventDispatcher
 Inherited
validate(value:*):void
Evaluates the specified value and throw a TypeError object if the value is not valid.
CoreModelObject
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
CoreEventDispatcher
Protected Methods
 MethodDefined By
 Inherited
Creates and returns the internal EventDispatcher reference (this method is invoked in the constructor).
CoreEventDispatcher
Constructor Detail
CollectionModelObject()Constructor
public function CollectionModelObject(global:Boolean = true, channel:String = null, id:* = null)

Creates a new CollectionModelObject instance.

Parameters
global:Boolean (default = true) — the flag to use a global event flow or a local event flow (default true).
 
channel:String (default = null) — (optional) the name of the global event flow if the global argument is true.
 
id:* (default = null) — the id of this model.
Method Detail
addVO()method
public function addVO(vo:ValueObject):Boolean

Inserts a value object in the model.

Parameters

vo:ValueObject

Returns
Boolean

Throws
ArgumentError — if the argument of this method is 'null' or 'undefined'.
 
TypeMismatchError — if the ValueObject passed in argument isn't valide.
clear()method 
override public function clear():void

Removes all value objects in the model.

contains()method 
public function contains(vo:ValueObject):Boolean

Returns true if the model contains the specified ValueObject.

Parameters

vo:ValueObject

Returns
Booleantrue if the model contains the specified ValueObject.
containsByProperty()method 
public function containsByProperty(propName:String, value:*):Boolean

Returns true if the model contains the specified attribute value.

Parameters

propName:String
 
value:*

Returns
Booleantrue if the model contains the specified id key in argument
getCollection()method 
public function getCollection():Collection

Returns the internal Collection of this model.

Returns
Collection — the internal Collection of this model.
getEventTypeADD()method 
public function getEventTypeADD():String

Returns the event name use in the addVO method.

Returns
String — the event name use in the addVO method.
getEventTypeREMOVE()method 
public function getEventTypeREMOVE():String

Returns the event name use in the removeVO method.

Returns
String — the event name use in the removeVO method.
initEventType()method 
override public function initEventType():void

This method is invoked in the constructor of the class to initialize all events. Overrides this method.

initializeCollection()method 
public function initializeCollection():Collection

Initialize the internal Collection instance in the constructor of the class. You can overrides this method if you want change the default SimpleCollection use in this model.

Returns
Collection
isEmpty()method 
public function isEmpty():Boolean

Returns {

Returns
Boolean — {
iterator()method 
public function iterator():Iterator

Returns the iterator of this model.

Returns
Iterator — the iterator of this model.
notifyAdd()method 
public function notifyAdd(vo:ValueObject):void

Notify a ModelObjectEvent when a ValueObject is inserted in the model.

Parameters

vo:ValueObject

notifyRemove()method 
public function notifyRemove(vo:ValueObject):void

Notify a ModelObjectEvent when a ValueObject is removed in the model.

Parameters

vo:ValueObject

removeVO()method 
public function removeVO(vo:ValueObject):*

Removes a value object in the model.

Parameters

vo:ValueObject

Returns
*

Throws
ArgumentError — If the ValueObject passed in argument not must be 'null' or 'undefined'.
 
ArgumentError — if the value object don't exist in the model.
setCollection()method 
public function setCollection(co:Collection):void

Sets the internal Collection of this model. By default the initializeCollection() method is used if the passed-in argument is null.

Parameters

co:Collection

setEventTypeADD()method 
public function setEventTypeADD(type:String):void

Sets the event name use in the addVO method.

Parameters

type:String

setEventTypeREMOVE()method 
public function setEventTypeREMOVE(type:String):void

Sets the event name use in the removeVO method.

Parameters

type:String

size()method 
public function size():Number

Returns the number of ValueObject in this model.

Returns
Number — the number of ValueObject in this model.
toArray()method 
public function toArray():Array

Returns the Array representation of this object.

Returns
Array — the Array representation of this object.