Packagecom.yworks.support
Classpublic class EmptyList
InheritanceEmptyList Inheritance flash.utils.Proxy
Implements List

A utility class that implements an immutable always empty list.

See also

EmptyIterable
EmptyIterator


Public Methods
 MethodDefined By
  
EmptyList
  
addAll(it:Iterable):void
Not supported by this implementation.
EmptyList
  
addItem(item:Object):Boolean
Not supported by this implementation.
EmptyList
  
clear():void
Removes all of the elements from this collection.
EmptyList
  
contains(item:Object):Boolean
Always retuns false.
EmptyList
  
getItemAt(index:int):Object
Returns the element at the specified position in this collection.
EmptyList
  
indexOf(item:Object):int
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
EmptyList
  
insert(item:Object, index:uint):void
Not supported by this implementation.
EmptyList
  
isEmpty():Boolean
EmptyList
  
EmptyList
  
length():uint
Returns the number of elements in this collection.
EmptyList
  
removeAt(index:uint):void
Removes the element at the specified position in this list.
EmptyList
  
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation).
EmptyList
  
sort(comparisonFunction:Function = null, sortOptions:int = -1):void
Sorts the List by using a comparisionFunction.
EmptyList
  
toArray():Array
Returns an array containing all of the elements in this collection.
EmptyList
Public Constants
 ConstantDefined By
  instance : EmptyList
[static] A shareable static instance of this class.
EmptyList
Constructor Detail
EmptyList()Constructor
public function EmptyList()



Method Detail
addAll()method
public function addAll(it:Iterable):void

Not supported by this implementation.

Parameters

it:Iterable


Throws
flash.errors:IllegalOperationError — always
addItem()method 
public function addItem(item:Object):Boolean

Not supported by this implementation.

Parameters

item:Object

Returns
Boolean

Throws
flash.errors:IllegalOperationError — always
clear()method 
public function clear():void

Removes all of the elements from this collection. The collection will be empty after this method returns.

contains()method 
public function contains(item:Object):Boolean

Always retuns false.

Parameters

item:Object

Returns
Boolean
getItemAt()method 
public function getItemAt(index:int):Object

Returns the element at the specified position in this collection.

Parameters

index:int — the index of the element to return

Returns
Object — null
indexOf()method 
public function indexOf(item:Object):int

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

Parameters

item:Object — the element to search for

Returns
int — the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element
insert()method 
public function insert(item:Object, index:uint):void

Not supported by this implementation.

Parameters

item:Object
 
index:uint


Throws
flash.errors:IllegalOperationError — always
isEmpty()method 
public function isEmpty():Boolean

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

Returns
Iterator
length()method 
public function length():uint

Returns the number of elements in this collection.

Returns
uint — 0
removeAt()method 
public function removeAt(index:uint):void

Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).

Parameters

index:uint — the index of the element to be removed


Throws
RangeError — always
removeItem()method 
public function removeItem(item:Object):Boolean

Removes a single instance of the specified element from this collection, if it is present (optional operation).

Parameters

item:Object — element to be removed from this collection, if present

Returns
Boolean — true if an element was removed as a result of this call
sort()method 
public function sort(comparisonFunction:Function = null, sortOptions:int = -1):void

Sorts the List by using a comparisionFunction.

Parameters

comparisonFunction:Function (default = null) — A function used for comparison
 
sortOptions:int (default = -1) — An optional option parameter

toArray()method 
public function toArray():Array

Returns an array containing all of the elements in this collection.

Returns
Array — an array containing all of the elements in this collection
Constant Detail
instanceConstant
public static const instance:EmptyList

A shareable static instance of this class.