Packagevegas.data.array
Classpublic class ArrayFilter
InheritanceArrayFilter Inheritance CoreEventDispatcher Inheritance CoreObject

This filter contains all constants and methods to sort the Arrays in the application.

Example :

     import vegas.data.array.ArrayFilter ;
     
     import vegas.events.BasicEvent ;
     
     var debug:Function = function ():Void
     {
         trace("filter : " + af.filter ) ;
         trace("is NONE               : " + af.isNone() )
         trace("is CASEINSENSITIVE    : " + af.isCaseInsensitive() ) ;
         trace("is DESCENDING         : " + af.isDescending() ) ;
         trace("is NUMERIC            : " + af.isNumeric() ) ;
         trace("is RETURNINDEXEDARRAY : " + af.isReturnIndexedArray() ) ;
         trace("is UNIQUESORT         : " + af.isUniqueSort() ) ;
         trace("---") ;
     }
     
     var change:Function = function ( e:BasicEvent ):Void
     {
         trace( e ) ;
     }
     
     var af:ArrayFilter = ArrayFilter.getInstance() ;
     af.addEventListener( ArrayFilter.CHANGE, change ) ;
     
     debug() ;
     
     af.setCaseInsensitive( true ) ;
     af.setDescending( true ) ;
     af.setNumeric( true ) ;
     af.setReturnIndexedArray( true ) ;
     af.setUniqueSort( true ) ;
     debug() ;
     
     af.setCaseInsensitive( false ) ;
     debug() ;
     
     af.setDescending( false ) ;
     debug() ;
     
     af.setNumeric( false ) ;
     debug() ;
     
     af.setReturnIndexedArray( false) ;
     debug() ;
     
     af.setUniqueSort( false ) ;
     debug() ;
     



Public Properties
 PropertyDefined by
  CASEINSENSITIVE : uint = 1.0
[static] Specifies case-insensitive sorting for the Array class sorting methods.
ArrayFilter
  CHANGE : String = "change"
[static] The change event occurs when the filter value is changed.
ArrayFilter
 Inheritedchannel : String
Indicates the channel of this dispatcher if this instance is global.
CoreEventDispatcher
  DESCENDING : uint = 2.0
[static] Specifies descending sorting for the Array class sorting methods.
ArrayFilter
  filter : uint
Returns the current filter value of this object.
ArrayFilter
 InheritedisGlobal : Boolean
(read-only) Returns the value of the isGlobal flag of this model.
CoreEventDispatcher
  NONE : uint = 0
[static] Specifies the default numeric sorting value for the Array class sorting methods.
ArrayFilter
  NUMERIC : uint = 16.0
[static] Specifies numeric (instead of character-string) sorting for the Array class sorting methods.
ArrayFilter
  RETURNINDEXEDARRAY : uint = 8.0
[static] Specifies that a sort returns an array that consists of array indices as a result of calling the sort() or sortOn() method.
ArrayFilter
  UNIQUESORT : uint = 4.0
[static] Specifies the unique sorting requirement for the Array class sorting methods.
ArrayFilter
  useEvent : Boolean = true
Indicates if the change event is notify or not when the filter value change.
ArrayFilter
Public Methods
 MethodDefined by
  
ArrayFilter(value:uint = 0, bGlobal:Boolean = false, sChannel:String = null)
Creates a new ArrayFilter instance.
ArrayFilter
 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
  
contains(nFilter:uint, nOption:uint):Boolean
[static] Returns true if the filter number value contains the option number value.
ArrayFilter
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
CoreEventDispatcher
 Inherited
Returns the internal EventDispatcher reference.
CoreEventDispatcher
  
Returns the event name of the change event of this object.
ArrayFilter
  
getFilter():uint
Returns the current filter value of this object.
ArrayFilter
  
[static] Returns the singleton reference of this class.
ArrayFilter
 Inherited
getIsGlobal():Boolean
Returns the value of the isGlobal flag of this model.
CoreEventDispatcher
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
CoreEventDispatcher
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
 Inherited
Creates and returns the internal EventDispatcher reference (this method is invoked in the constructor).
CoreEventDispatcher
  
Returns true if the CASEINSENSITIVE option value exist in the current filter.
ArrayFilter
  
isDescending():Boolean
Returns true if the DESCENDING option value exist in the current filter.
ArrayFilter
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreEventDispatcher
  
isNone():Boolean
Returns true if the filter is NONE.
ArrayFilter
  
isNumeric():Boolean
Returns true if the NUMERIC option value exist in the current filter.
ArrayFilter
  
Returns true if the RETURNINDEXEDARRAY option value exist in the current filter.
ArrayFilter
  
isUniqueSort():Boolean
Returns true if the UNIQUESORT option value exist in the current filter.
ArrayFilter
 Inherited
lock():void
Locks the object.
CoreEventDispatcher
  
notifyChange():void
Notify a change in this object.
ArrayFilter
 Inherited
registerEventListener(type:String, listener:Boolean, useCapture:int = false, priority:Boolean = 0, useWeakReference:* = 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
  
setCaseInsensitive(b:Boolean):void
Sets the CASEINSENSITIVE option value in the current filter.
ArrayFilter
  
setDescending(b:Boolean):void
Sets the DESCENDING option value in the current filter.
ArrayFilter
 Inherited
Sets the internal EventDispatcher reference.
CoreEventDispatcher
  
setEventTypeCHANGE(type:String):void
Sets the event name of the change event of this object.
ArrayFilter
  
setFilter(n:uint):void
Sets the current filter value of this object.
ArrayFilter
 Inherited
setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher.
CoreEventDispatcher
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
  
setNone():void
Sets the NONE option value in the current filter.
ArrayFilter
  
setNumeric(b:Boolean):void
Sets the NUMERIC option value in the current filter.
ArrayFilter
  
setReturnIndexedArray(b:Boolean):void
Sets the RETURNINDEXEDARRAY option value in the current filter.
ArrayFilter
  
setUniqueSort(b:Boolean):void
Sets the UNIQUESORT option value in the current filter.
ArrayFilter
  
toSource(indent:int = 0):String
Returns a eden String representation of the object.
ArrayFilter
 Inherited
toString():String
Returns the string representation of this instance.
CoreObject
 Inherited
unlock():void
Unlocks the display.
CoreEventDispatcher
 Inherited
unregisterEventListener(type:String, listener:Boolean, useCapture:* = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object.
CoreEventDispatcher
 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
Property detail
CASEINSENSITIVEproperty
public static var CASEINSENSITIVE:uint = 1.0

Specifies case-insensitive sorting for the Array class sorting methods. You can use this constant for the options parameter in the sort() or sortOn() method.

The value of this constant is 1.

CHANGEproperty 
public static var CHANGE:String = "change"

The change event occurs when the filter value is changed.

DESCENDINGproperty 
public static var DESCENDING:uint = 2.0

Specifies descending sorting for the Array class sorting methods. You can use this constant for the options parameter in the sort() or sortOn() method.

The value of this constant is 2.

filterproperty 
filter:uint  [read-write]

Returns the current filter value of this object.

Implementation
    public function get filter():uint
    public function set filter(value:uint):void
NONEproperty 
public static var NONE:uint = 0

Specifies the default numeric sorting value for the Array class sorting methods.

The value of this constant is 0.

NUMERICproperty 
public static var NUMERIC:uint = 16.0

Specifies numeric (instead of character-string) sorting for the Array class sorting methods. Including this constant in the options parameter causes the sort() and sortOn() methods to sort numbers as numeric values, not as strings of numeric characters. Without the NUMERIC constant, sorting treats each array element as a character string and produces the results in Unicode order.

For example, given the array of values [2005, 7, 35], if the NUMERIC constant is not included in the options parameter, the sorted array is [2005, 35, 7], but if the NUMERIC constant is included, the sorted array is [7, 35, 2005].

This constant applies only to numbers in the array; it does not apply to strings that contain numeric data such as ["23", "5"].

The value of this constant is 16.

RETURNINDEXEDARRAYproperty 
public static var RETURNINDEXEDARRAY:uint = 8.0

Specifies that a sort returns an array that consists of array indices as a result of calling the sort() or sortOn() method. You can use this constant for the options parameter in the sort() or sortOn() method, so you have access to multiple views on the array elements while the original array is unmodified.

The value of this constant is 8.

UNIQUESORTproperty 
public static var UNIQUESORT:uint = 4.0

Specifies the unique sorting requirement for the Array class sorting methods. You can use this constant for the options parameter in the sort() or sortOn() method. The unique sorting option terminates the sort if any two elements or fields being sorted have identical values.

The value of this constant is 4.

useEventproperty 
public var useEvent:Boolean = true

Indicates if the change event is notify or not when the filter value change.

Constructor detail
ArrayFilter()constructor
public function ArrayFilter(value:uint = 0, bGlobal:Boolean = false, sChannel:String = null)

Creates a new ArrayFilter instance.

Parameters
value:uint (default = 0) — the default filter value of this instance. If this argument is null the filter value is ArrayFilter.NONE(0).
 
bGlobal:Boolean (default = false) — the flag to use a global event flow or a local event flow.
 
sChannel:String (default = null) — the name of the global event flow if the bGlobal argument is true.
Method detail
contains()method
public static function contains(nFilter:uint, nOption:uint):Boolean

Returns true if the filter number value contains the option number value.

Parameters
nFilter:uint
 
nOption:uint

Returns
Booleantrue if the filter number value contains the option number value.
getEventTypeCHANGE()method 
public function getEventTypeCHANGE():String

Returns the event name of the change event of this object.

Returns
String — the event name of the change event of this object.
getFilter()method 
public function getFilter():uint

Returns the current filter value of this object.

Returns
uint — the current filter value of this object.
getInstance()method 
public static function getInstance():ArrayFilter

Returns the singleton reference of this class.

Returns
ArrayFilter — the singleton reference of this class.
isCaseInsensitive()method 
public function isCaseInsensitive():Boolean

Returns true if the CASEINSENSITIVE option value exist in the current filter.

Returns
Booleantrue if the CASEINSENSITIVE option value exist in the current filter.
isDescending()method 
public function isDescending():Boolean

Returns true if the DESCENDING option value exist in the current filter.

Returns
Booleantrue if the DESCENDING option value exist in the current filter.
isNone()method 
public function isNone():Boolean

Returns true if the filter is NONE.

Returns
Booleantrue if the filter is NONE.
isNumeric()method 
public function isNumeric():Boolean

Returns true if the NUMERIC option value exist in the current filter.

Returns
Booleantrue if the NUMERIC option value exist in the current filter.
isReturnIndexedArray()method 
public function isReturnIndexedArray():Boolean

Returns true if the RETURNINDEXEDARRAY option value exist in the current filter.

Returns
Booleantrue if the RETURNINDEXEDARRAY option value exist in the current filter.
isUniqueSort()method 
public function isUniqueSort():Boolean

Returns true if the UNIQUESORT option value exist in the current filter.

Returns
Booleantrue if the UNIQUESORT option value exist in the current filter.
notifyChange()method 
public function notifyChange():void

Notify a change in this object.

setCaseInsensitive()method 
public function setCaseInsensitive(b:Boolean):void

Sets the CASEINSENSITIVE option value in the current filter.

Parameters
b:Boolean
setDescending()method 
public function setDescending(b:Boolean):void

Sets the DESCENDING option value in the current filter.

Parameters
b:Boolean
setEventTypeCHANGE()method 
public function setEventTypeCHANGE(type:String):void

Sets the event name of the change event of this object.

Parameters
type:String
setFilter()method 
public function setFilter(n:uint):void

Sets the current filter value of this object.

Parameters
n:uint
setNone()method 
public function setNone():void

Sets the NONE option value in the current filter.

setNumeric()method 
public function setNumeric(b:Boolean):void

Sets the NUMERIC option value in the current filter.

Parameters
b:Boolean
setReturnIndexedArray()method 
public function setReturnIndexedArray(b:Boolean):void

Sets the RETURNINDEXEDARRAY option value in the current filter.

Parameters
b:Boolean
setUniqueSort()method 
public function setUniqueSort(b:Boolean):void

Sets the UNIQUESORT option value in the current filter.

Parameters
b:Boolean
toSource()method 
public override function toSource(indent:int = 0):String

Returns a eden String representation of the object.

Parameters
indent:int (default = 0)

Returns
String — a string representation the source code of the object.