Packagecom.yworks.bridge.util
Interfacepublic interface List extends Collection
Implementors AbstractList, ArrayList, LinkedList, YList

List is a collection which maintains an ordering for its elements. Every element in the list has an index.



Public Properties
 PropertyDefined By
 Inheritedempty : Boolean
[read-only] Answers if this Collection has no elements, a size of zero.
Collection
 Inheritedlength : int
[read-only] Returns a count of how many objects are contained by this collection.
Collection
Public Methods
 MethodDefined By
 Inherited
addAll(collection:Collection):Boolean
Attempts to add all of the objects contained in collection to the contents of this collection.
Collection
  
addAllAt(location:int, collection:Collection):Boolean
Inserts the objects in the specified Collection at the specified location in this List.
List
 Inherited
addItem(object:Object):Boolean
Attempts to add object to the contents of this Collection.
Collection
  
addItemAt(location:int, object:Object):void
Inserts the specified object into this Vector at the specified location.
List
 Inherited
clear():void
Removes all elements from this Collection, leaving it empty.
Collection
 Inherited
containsAll(collection:Collection):Boolean
Searches this Collection for all objects in the specified Collection.
Collection
 Inherited
containsItem(object:Object):Boolean
Searches this Collection for the specified object.
Collection
  
getItemAt(location:int):Object
Answers the element at the specified location in this List.
List
  
indexOf(object:Object):int
Searches this List for the specified object and returns the index of the first occurrence.
List
 Inherited
Returns an instance of com.yworks.bridge.util.Iterator that may be used to access the objects contained by this collection.
Collection
  
lastIndexOf(object:Object):int
Searches this List for the specified object and returns the index of the last occurrence.
List
  
Answers a ListIterator on the elements of this List.
List
  
Answers a ListIterator on the elements of this List.
List
 Inherited
removeAll(collection:Collection):Boolean
Removes all occurrences in this Collection of each object in the specified Collection.
Collection
 Inherited
removeItem(object:Object):Boolean
Removes the first occurrence of the specified object from this Collection.
Collection
  
removeItemAt(location:int):Object
Removes the object at the specified location from this List.
List
 Inherited
retainAll(collection:Collection):Boolean
Removes all objects from this Collection that are not also found in the contents of collection.
Collection
  
setItemAt(location:int, object:Object):Object
Replaces the element at the specified location in this List with the specified object.
List
  
subList(start:int, end:int):List
Answers a List of the specified portion of this List from the start index to one less than the end index.
List
 Inherited
toArray():Vector.<Object>
Answers a new array containing all elements contained in this Collection.
Collection
 Inherited
toArray2(array:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this Collection.
Collection
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()
addItemAt()method 
public function addItemAt(location:int, object:Object):void

Inserts the specified object into this Vector 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()
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 location

Throws
RangeError — when location < 0 || >= size()
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
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()
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

Answers a List of the specified portion of this List from the start index to one less than the end index. The returned List is backed by this list so changes to one are reflected by the other.

Parameters

start:int — the index at which to start the sublist
 
end:int — the index one past the end of the sublist

Returns
List — a List of a portion of this List

Throws
RangeError — when start < 0, start > end or end > size()