Packagecom.yworks.bridge.util
Classpublic class AbstractList
InheritanceAbstractList Inheritance AbstractCollection Inheritance YObject Inheritance Object
Implements List
Subclasses AbstractSequentialList, ArrayList

AbstractList is an abstract implementation of the List interface, optimized for a backing store which supports random access. This implementation does not support adding or replacing. A subclass must implement the abstract methods get() and size().



Public Properties
 PropertyDefined By
 Inheritedempty : Boolean
[read-only] Returns true if the collection has no element, otherwise false.
AbstractCollection
 Inheritedlength : int
[read-only] Answers the number of elements in this Collection.
AbstractCollection
  modCountInternal : int
AbstractList
Protected Properties
 PropertyDefined By
  modCount : int
AbstractList
Public Methods
 MethodDefined By
  
AbstractList(init:Boolean = true)
Constructs a new instance of this AbstractList.
AbstractList
 Inherited
addAll(collection:Collection):Boolean
Adds the objects in the specified Collection to this Collection.
AbstractCollection
  
addAllAt(location:int, collection:Collection):Boolean
Inserts the objects in the specified Collection at the specified location in this List.
AbstractList
  
addItem(object:Object):Boolean
[override] Adds the specified object at the end of this List.
AbstractList
  
addItemAt(location:int, object:Object):void
Inserts the specified object into this List at the specified location.
AbstractList
  
clear():void
[override] Removes all elements from this List, leaving it empty.
AbstractList
  
clone():Object
[override]
AbstractList
 Inherited
containsAll(collection:Collection):Boolean
Searches this Collection for all objects in the specified Collection.
AbstractCollection
 Inherited
containsItem(object:Object):Boolean
Searches this Collection for the specified object.
AbstractCollection
  
equals(object:Object):Boolean
[override] Compares the specified object to this List and answer if they are equal.
AbstractList
  
getClass():Class
[override]
AbstractList
  
getItemAt(location:int):Object
Answers the element at the specified location in this List.
AbstractList
  
hashCode():int
[override] Answers an integer hash code for the receiver.
AbstractList
  
indexOf(object:Object):int
Searches this List for the specified object and returns the index of the first occurrence.
AbstractList
  
[override] Answers an Iterator on the elements of this List.
AbstractList
  
lastIndexOf(object:Object):int
Searches this List for the specified object and returns the index of the last occurrence.
AbstractList
  
Answers a ListIterator on the elements of this List.
AbstractList
  
Answers a ListIterator on the elements of this List.
AbstractList
 Inherited
removeAll(collection:Collection):Boolean
Removes all occurrences in this Collection of each object in the specified Collection.
AbstractCollection
 Inherited
removeItem(object:Object):Boolean
Removes the first occurrence of the specified object from this Collection.
AbstractCollection
  
removeItemAt(location:int):Object
Removes the object at the specified location from this List.
AbstractList
 Inherited
retainAll(collection:Collection):Boolean
Removes all objects from this Collection that are not contained in the specified Collection.
AbstractCollection
  
setItemAt(location:int, object:Object):Object
Replaces the element at the specified location in this List with the specified object.
AbstractList
  
subList(start:int, end:int):List
Returns a part of consecutive elements of this list as a view.
AbstractList
 Inherited
toArray():Vector.<Object>
Answers a new array containing all elements contained in this Collection.
AbstractCollection
 Inherited
toArray2(contents:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this Collection.
AbstractCollection
 Inherited
toString():String
Answers the string representation of this Collection.
AbstractCollection
Protected Methods
 MethodDefined By
  
cloneImpl(o:Object):void
[override]
AbstractList
 Inherited
AbstractCollection
  
AbstractList
  
removeRange(start:int, end:int):void
Removes the objects in the specified range from the start to the, but not including, end index.
AbstractList
Property Detail
modCountproperty
protected var modCount:int

modCountInternalproperty 
modCountInternal:int


Implementation
    public function get modCountInternal():int
    public function set modCountInternal(value:int):void
Constructor Detail
AbstractList()Constructor
public function AbstractList(init:Boolean = true)

Constructs a new instance of this AbstractList.

Parameters
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
addAllAt()method
public function addAllAt(location:int, collection:Collection):Boolean

Inserts the objects in the specified Collection at the specified location in this List. The objects are added in the order they are returned from the Collection iterator.

Parameters

location:int — the index at which to insert
 
collection:Collection — the Collection of objects

Returns
Boolean — true if this List is modified, false otherwise

Throws
flash.errors:IllegalOperationError — when adding to this List is not supported
 
TypeError — when the class of an object is inappropriate for this List
 
IllegalArgumentException — when an object cannot be added to this List
 
RangeError — when location < 0 || >= size()
addItem()method 
override public function addItem(object:Object):Boolean

Adds the specified object at the end of this List.

Parameters

object:Object — the object to add

Returns
Boolean — true

Throws
flash.errors:IllegalOperationError — when adding to this List is not supported
 
TypeError — when the class of the object is inappropriate for this List
 
IllegalArgumentException — when the object cannot be added to this List
addItemAt()method 
public function addItemAt(location:int, object:Object):void

Inserts the specified object into this List at the specified location. The object is inserted before any previous element at the specified location. If the location is equal to the size of this List, the object is added at the end.

Parameters

location:int — the index at which to insert
 
object:Object — the object to add


Throws
flash.errors:IllegalOperationError — when adding to this List is not supported
 
TypeError — when the class of the object is inappropriate for this List
 
IllegalArgumentException — when the object cannot be added to this List
 
RangeError — when location < 0 || >= size()
clear()method 
override public function clear():void

Removes all elements from this List, leaving it empty.


Throws
flash.errors:IllegalOperationError — when removing from this List is not supported

See also

clone()method 
override public function clone():Object

Returns
Object
cloneImpl()method 
override protected function cloneImpl(o:Object):void

Parameters

o:Object

equals()method 
override public function equals(object:Object):Boolean

Compares the specified object to this List and answer if they are equal. The object must be a List which contains the same objects in the same order.

Parameters

object:Object — the object to compare with this object

Returns
Boolean — true if the specified object is equal to this List, false otherwise

See also

getClass()method 
override public function getClass():Class

Returns
Class
getItemAt()method 
public function getItemAt(location:int):Object

Answers the element at the specified location in this List.

Parameters

location:int — the index of the element to return

Returns
Object — the element at the specified index

Throws
RangeError — when location < 0 || >= size()
hashCode()method 
override public function hashCode():int

Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Returns
int — the receiver's hash

See also

indexOf()method 
public function indexOf(object:Object):int

Searches this List for the specified object and returns the index of the first occurrence.

Parameters

object:Object — the object to search for

Returns
int — the index of the first occurrence of the object
initAbstractList()method 
protected final function initAbstractList():void

iterator()method 
override public function iterator():Iterator

Answers an Iterator on the elements of this List. The elements are iterated in the same order that they occur in the List.

Returns
Iterator — an Iterator on the elements of this List

See also

lastIndexOf()method 
public function lastIndexOf(object:Object):int

Searches this List for the specified object and returns the index of the last occurrence.

Parameters

object:Object — the object to search for

Returns
int — the index of the last occurrence of the object
listIterator()method 
public function listIterator():ListIterator

Answers a ListIterator on the elements of this List. The elements are iterated in the same order that they occur in the List.

Returns
ListIterator — a ListIterator on the elements of this List

See also

listIterator2()method 
public function listIterator2(location:int):ListIterator

Answers a ListIterator on the elements of this List. The elements are iterated in the same order that they occur in the List. The iteration starts at the specified location.

Parameters

location:int — the index at which to start the iteration

Returns
ListIterator — a ListIterator on the elements of this List

Throws
RangeError — when location < 0 || >= size()

See also

removeItemAt()method 
public function removeItemAt(location:int):Object

Removes the object at the specified location from this List.

Parameters

location:int — the index of the object to remove

Returns
Object — the removed object

Throws
flash.errors:IllegalOperationError — when removing from this List is not supported
 
RangeError — when location < 0 || >= size()
removeRange()method 
protected function removeRange(start:int, end:int):void

Removes the objects in the specified range from the start to the, but not including, end index.

Parameters

start:int — the index at which to start removing
 
end:int — the index one past the end of the range to remove

setItemAt()method 
public function setItemAt(location:int, object:Object):Object

Replaces the element at the specified location in this List with the specified object.

Parameters

location:int — the index at which to put the specified object
 
object:Object — the object to add

Returns
Object — the previous element at the index

Throws
flash.errors:IllegalOperationError — when replacing elements in this List is not supported
 
TypeError — when the class of an object is inappropriate for this List
 
IllegalArgumentException — when an object cannot be added to this List
 
RangeError — when location < 0 || >= size()
subList()method 
public function subList(start:int, end:int):List

Returns a part of consecutive elements of this list as a view. From start (inclusive), to end(exclusive). The returned view will be of zero length if start equals end. Any change occurs in the returned subList will be reflected to the original list, and vice-versa. All the supported optional operations by the original list will also be supported by this subList. This method can be used as a handy method to do some operations on a sub range of the original list. For example: list.subList(from, to).clear(); If the original list is modified other than through the returned subList, the behavior of the returned subList becomes undefined. The returned subList is a subclass of AbstractList. The subclass stores offset, size of itself, and modCount of the original list. If the original list implements RandomAccess interface, the returned subList also implements RandomAccess interface. The subList's set(int, Object), get(int), add(int, Object), remove(int), addAll(int, Collection) and removeRange(int, int) methods first check the bounds, adjust offsets and then call the corresponding methods of the original AbstractList. addAll(Collection c) method of the returned subList calls the original addAll(offset + size, c). The listIterator(int) method of the subList wraps the original list iterator. The iterator() method of the subList invokes the original listIterator() method, and the size() method merely returns the size of the subList. All methods will throw a ConcurrentModificationException if the modCount of the original list is not equal to the expected value.

Parameters

start:int — start index of the subList, include start
 
end:int — end index of the subList, exclude end

Returns
List — a subList view of this list start from start (inclusive), end with end (exclusive)

Throws
RangeError — when (start < 0 || end > size())
 
IllegalArgumentException — when (start > end)