| Package | vegas.util.comparators |
| Class | public class GenericComparator |
| Inheritance | GenericComparator CoreObject |
| Implements | IComparator |
Example :
import vegas.events.Delegate ;
import vegas.util.comparators.GenericComparator ;
import vegas.util.comparators.StringComparator ;
var write:Function = function( ar:Array ):void
{
var result:Array = [] ;
var size:uint = ar.length ;
for (var i:uint = 0 ; i
| Property | Defined by | ||
|---|---|---|---|
| comparator : IComparator
The IComparator used by this IComparator to compare two objects with this specified field.
| GenericComparator | ||
| sortBy : String
A String who represents a property name to compare the two objects.
| GenericComparator | ||
| Method | Defined by | ||
|---|---|---|---|
|
GenericComparator(sortBy:String, comparator:IComparator)
Creates a new GenericComparator instance.
| GenericComparator | ||
|
clone():*
Creates and returns a shallow copy of the object.
| GenericComparator | ||
|
compare(o1:*, o2:*):int
Returns an integer value to compare two objects.
| GenericComparator | ||
![]() |
Returns the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
hashCode():uint
Returns a hashcode value for the object.
| CoreObject | |
![]() |
Sets the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
| CoreObject | |
![]() |
toString():String
Returns the string representation of this instance.
| CoreObject | |
| comparator | property |
public var comparator:IComparatorThe IComparator used by this IComparator to compare two objects with this specified field.
| sortBy | property |
public var sortBy:StringA String who represents a property name to compare the two objects.
| GenericComparator | () | constructor |
public function GenericComparator(sortBy:String, comparator:IComparator)Creates a new GenericComparator instance.
ParameterssortBy:String — A String who represents a property name to compare the two objects.
|
|
comparator:IComparator — An IComparator use to compare the two objects with the specified property names.
|
— If the 'sortBy' argument is 'null' or 'undefined'.
|
|
— If the 'comparator' argument is 'null' or 'undefined'.
|
| clone | () | method |
public function clone():*Creates and returns a shallow copy of the object.
Returns* — A new object that is a shallow copy of this instance.
|
| compare | () | method |
public function compare(o1:*, o2:*):intReturns an integer value to compare two objects.
Parameterso1:* — the first Number object to compare.
|
|
o2:* — the second Number object to compare.
|
int —
|
— |