Packagevegas.models.maps
Classpublic class MapModelObject
InheritanceMapModelObject Inheritance CoreModelObject Inheritance CoreModel Inheritance CoreEventDispatcher Inheritance Object
Implements Iterable
Subclasses IndexedMapModelObject, OrderedMapModelObject

This model use an internal Map to register value objects with a specific key.



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
Protected Properties
 PropertyDefined By
  _map : Map
The internal map of this model.
MapModelObject
  _sAddType : String
The internal ModelObjectEvent type use in the addVO method.
MapModelObject
  _sRemoveType : String
The internal ModelObjectEvent type use in the removeVO method.
MapModelObject
  _sUpdateType : String
The internal ModelObjectEvent type when the update event type is use.
MapModelObject
Public Methods
 MethodDefined By
  
MapModelObject(global:Boolean = true, channel:String = null, factory:Map = null, id:* = null)
Creates a new MapModelObject instance.
MapModelObject
 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
  
Inserts a value object in the model.
MapModelObject
  
clear():void
[override] Removes all value objects in the model.
MapModelObject
  
contains(vo:ValueObject):Boolean
Returns true if the model contains the specified ValueObject.
MapModelObject
  
containsByID(id:*):Boolean
Returns true if the model contains the specified id key in argument.
MapModelObject
  
containsByProperty(propName:String, value:*):Boolean
Returns true if the model contains the specified attribute value.
MapModelObject
 Inherited
Returns and creates a new empty ModelObjectEvent.
CoreModelObject
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
CoreEventDispatcher
 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.
MapModelObject
 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.
MapModelObject
  
Returns the event name use in the updateVO method.
MapModelObject
  
Returns the internal map of this model.
MapModelObject
  
Returns the ValueObject defined by the id passed in argument.
MapModelObject
  
getVOByProperty(propName:String, value:*):ValueObject
Returns a ValueObject if the model contains a ValueObject with the specified member.
MapModelObject
 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.
MapModelObject
  
Initialize the internal Map instance in the constructor of the class.
MapModelObject
  
isEmpty():Boolean
Returns true if the model is empty.
MapModelObject
 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.
MapModelObject
 Inherited
lock():void
Locks the object.
CoreEventDispatcher
  
Notify a ModelObjectEvent when a ValueObject is inserted in the model.
MapModelObject
 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.
MapModelObject
  
Notify a ModelObjectEvent when a ValueObject is updated in the model.
MapModelObject
 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.
MapModelObject
 Inherited
run(... arguments):void
Run the first process with this model.
CoreModel
 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.
MapModelObject
 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.
MapModelObject
  
setEventTypeUPDATE(type:String):void
Sets the event name use in the addVO method.
MapModelObject
 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
  
setMap(m:Map):void
Sets the internal map of this model.
MapModelObject
  
size():Number
Returns the number of ValueObject in this model.
MapModelObject
 Inherited
supports(value:*):Boolean
Returns true if the IValidator object validate the value.
CoreModelObject
 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
  
Update a value object in the model.
MapModelObject
 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
Property Detail
_mapproperty
protected var _map:Map

The internal map of this model.

_sAddTypeproperty 
protected var _sAddType:String

The internal ModelObjectEvent type use in the addVO method.

_sRemoveTypeproperty 
protected var _sRemoveType:String

The internal ModelObjectEvent type use in the removeVO method.

_sUpdateTypeproperty 
protected var _sUpdateType:String

The internal ModelObjectEvent type when the update event type is use.

Constructor Detail
MapModelObject()Constructor
public function MapModelObject(global:Boolean = true, channel:String = null, factory:Map = null, id:* = null)

Creates a new MapModelObject 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.
 
factory:Map (default = null) — (optional) the Map factory reference used in the model to register all entries.
 
id:* (default = null) — the id of this model.
Method Detail
addVO()method
public function addVO(vo:ValueObject):void

Inserts a value object in the model.

Parameters

vo:ValueObject


Throws
ArgumentError — if the argument of this method is 'null' or 'undefined'.
 
ArgumentError — if the ValueObject passed in argument is already register in the model.
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.
containsByID()method 
public function containsByID(id:*):Boolean

Returns true if the model contains the specified id key in argument.

Parameters

id:*

Returns
Booleantrue if the model contains the specified id key in argument
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
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.
getEventTypeUPDATE()method 
public function getEventTypeUPDATE():String

Returns the event name use in the updateVO method.

Returns
String — the event name use in the updateVO method.
getMap()method 
public function getMap():Map

Returns the internal map of this model.

Returns
Map — the internal map of this model.
getVO()method 
public function getVO(id:*):ValueObject

Returns the ValueObject defined by the id passed in argument.

Parameters

id:*

Returns
ValueObject — the ValueObject defined by the id passed in argument.
getVOByProperty()method 
public function getVOByProperty(propName:String, value:*):ValueObject

Returns a ValueObject if the model contains a ValueObject with the specified member.

Parameters

propName:String
 
value:*

Returns
ValueObject — a ValueObject if the model contains a ValueObject with the specified member.
initEventType()method 
override public function initEventType():void

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

initializeMap()method 
public function initializeMap():Map

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

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

Returns true if the model is empty.

Returns
Booleantrue if the model is empty.
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

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

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

Parameters

vo:ValueObject

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

Removes a value object in the model.

Parameters

vo:ValueObject

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

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

Sets the event name use in the addVO method.

Parameters

type:String

setMap()method 
public function setMap(m:Map):void

Sets the internal map of this model. By default the 'initializeMap' method is used if the passed-in argument is null.

Parameters

m:Map

size()method 
public function size():Number

Returns the number of ValueObject in this model.

Returns
Number — the number of ValueObject in this model.
updateVO()method 
public function updateVO(vo:ValueObject):void

Update a value object in the model.

Parameters

vo:ValueObject


Throws
ArgumentError — if the value object passed-in argument don't exist.