Package | com.yworks.bridge.util |
Class | public class LinkedList |
Inheritance | LinkedList AbstractSequentialList AbstractList AbstractCollection YObject Object |
Implements | List, Clonable |
Property | Defined By | ||
---|---|---|---|
empty : Boolean [read-only]
Returns true if the collection has no element, otherwise false. | AbstractCollection | ||
first : Object [read-only]
Answers the first element in this LinkedList. | LinkedList | ||
last : Object [read-only]
Answers the last element in this LinkedList. | LinkedList | ||
length : int [override] [read-only]
Answers the number of elements in this LinkedList. | LinkedList | ||
modCountInternal : int | AbstractList |
Method | Defined By | ||
---|---|---|---|
LinkedList(init:Boolean = true)
Constructs a new empty instance of LinkedList. | LinkedList | ||
addAll(collection:Collection):Boolean [override]
Adds the objects in the specified Collection to this LinkedList. | LinkedList | ||
addAllAt(location:int, collection:Collection):Boolean [override]
Inserts the objects in the specified Collection at the specified location in this LinkedList. | LinkedList | ||
addFirst(object:Object):void
Adds the specified object at the beginning of this LinkedList. | LinkedList | ||
addItem(object:Object):Boolean [override]
Adds the specified object at the end of this LinkedList. | LinkedList | ||
addItemAt(location:int, object:Object):void [override]
Inserts the specified object into this LinkedList at the specified location. | LinkedList | ||
addLast(object:Object):void
Adds the specified object at the end of this LinkedList. | LinkedList | ||
clear():void [override]
Removes all elements from this LinkedList, leaving it empty. | LinkedList | ||
clone():Object [override]
Answers a new LinkedList with the same elements and size as this LinkedList. | LinkedList | ||
containsAll(collection:Collection):Boolean
Searches this Collection for all objects in the specified Collection. | AbstractCollection | ||
containsItem(object:Object):Boolean [override]
Searches this LinkedList for the specified object. | LinkedList | ||
element():Object | LinkedList | ||
equals(object:Object):Boolean [override]
Compares the specified object to this List and answer if they are equal. | AbstractList | ||
getClass():Class [override] | LinkedList | ||
getItemAt(location:int):Object [override] | LinkedList | ||
hashCode():int [override]
Answers an integer hash code for the receiver. | AbstractList | ||
indexOf(object:Object):int [override]
Searches this LinkedList for the specified object and returns the index of the first occurrence. | LinkedList | ||
[override]
Answers an Iterator on the elements of this List. | AbstractSequentialList | ||
lastIndexOf(object:Object):int [override]
Searches this LinkedList for the specified object and returns the index of the last occurrence. | LinkedList | ||
Answers a ListIterator on the elements of this List. | AbstractList | ||
listIterator2(location:int):ListIterator [override]
Answers a ListIterator on the elements of this LinkedList. | LinkedList | ||
[static]
Constructs a new empty instance of LinkedList. | LinkedList | ||
[static]
Constructs a new instance of LinkedList that holds all of the elements contained in the supplied collection argument. | LinkedList | ||
offer(o:Object):Boolean | LinkedList | ||
peek():Object | LinkedList | ||
poll():Object | LinkedList | ||
removeAll(collection:Collection):Boolean
Removes all occurrences in this Collection of each object in the specified Collection. | AbstractCollection | ||
removeFirst():Object
Removes the first object from this LinkedList. | LinkedList | ||
removeItem(object:Object):Boolean [override] | LinkedList | ||
removeItemAt(location:int):Object [override]
Removes the object at the specified location from this LinkedList. | LinkedList | ||
removeLast():Object
Removes the last object from this LinkedList. | LinkedList | ||
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 [override]
Replaces the element at the specified location in this LinkedList with the specified object. | LinkedList | ||
Returns a part of consecutive elements of this list as a view. | AbstractList | ||
toArray():Vector.<Object> [override]
Answers a new array containing all elements contained in this LinkedList. | LinkedList | ||
toArray2(contents:Vector.<Object>):Vector.<Object> [override]
Answers an array containing all elements contained in this LinkedList. | LinkedList | ||
toString():String
Answers the string representation of this Collection. | AbstractCollection |
Method | Defined By | ||
---|---|---|---|
cloneImpl(o:Object):void [override] | LinkedList | ||
initAbstractCollection():void | AbstractCollection | ||
initAbstractList():void | AbstractList | ||
initAbstractSequentialList():void | AbstractSequentialList | ||
initLinkedList1():void
Initializes this object. | LinkedList | ||
initLinkedList2(collection:Collection):void
Initializes this object. | LinkedList | ||
removeRange(start:int, end:int):void
Removes the objects in the specified range from the start to the, but not including, end index. | AbstractList |
first | property |
first:Object
[read-only] Answers the first element in this LinkedList.
public function get first():Object
Error — when this LinkedList is empty
|
last | property |
last:Object
[read-only] Answers the last element in this LinkedList.
public function get last():Object
Error — when this LinkedList is empty
|
length | property |
length:int
[read-only] [override] Answers the number of elements in this LinkedList.
public function get length():int
LinkedList | () | Constructor |
public function LinkedList(init:Boolean = true)
Constructs a new empty instance of LinkedList.
Parametersinit: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.
|
addAll | () | method |
override public function addAll(collection:Collection):Boolean
Adds the objects in the specified Collection to this LinkedList.
Parameters
collection:Collection — the Collection of objects
|
Boolean — true if this LinkedList is modified, false otherwise
|
addAllAt | () | method |
override public function addAllAt(location:int, collection:Collection):Boolean
Inserts the objects in the specified Collection at the specified location in this LinkedList.
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
|
Boolean — true if this LinkedList is modified, false otherwise
|
RangeError — when location < 0 || > size()
|
addFirst | () | method |
public function addFirst(object:Object):void
Adds the specified object at the beginning of this LinkedList.
Parameters
object:Object — the object to add
|
addItem | () | method |
override public function addItem(object:Object):Boolean
Adds the specified object at the end of this LinkedList.
Parameters
object:Object — the object to add
|
Boolean — true
|
addItemAt | () | method |
override public function addItemAt(location:int, object:Object):void
Inserts the specified object into this LinkedList 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 LinkedList, the object is added at the end.
Parameters
location:int — the index at which to insert
| |
object:Object — the object to add
|
RangeError — when location < 0 || >= size()
|
addLast | () | method |
public function addLast(object:Object):void
Adds the specified object at the end of this LinkedList.
Parameters
object:Object — the object to add
|
clear | () | method |
override public function clear():void
Removes all elements from this LinkedList, leaving it empty.
See also
clone | () | method |
override public function clone():Object
Answers a new LinkedList with the same elements and size as this LinkedList.
ReturnsObject — a shallow copy of this LinkedList
|
See also
cloneImpl | () | method |
override protected function cloneImpl(o:Object):void
Parameters
o:Object |
containsItem | () | method |
override public function containsItem(object:Object):Boolean
Searches this LinkedList for the specified object.
Parameters
object:Object — the object to search for
|
Boolean — true if object is an element of this LinkedList, false otherwise
|
element | () | method |
public function element():Object
ReturnsObject |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getItemAt | () | method |
override public function getItemAt(location:int):Object
Parameters
location:int |
Object |
indexOf | () | method |
override public function indexOf(object:Object):int
Searches this LinkedList for the specified object and returns the index of the first occurrence.
Parameters
object:Object — the object to search for
|
int — the index of the first occurrence of the object
|
initLinkedList1 | () | method |
protected final function initLinkedList1():void
Initializes this object. See the documentation of the corresponding factory method newLinkedList1()
for details.
See also
initLinkedList2 | () | method |
protected final function initLinkedList2(collection:Collection):void
Initializes this object. See the documentation of the corresponding factory method newLinkedList2()
for details.
Parameters
collection:Collection |
See also
lastIndexOf | () | method |
override public function lastIndexOf(object:Object):int
Searches this LinkedList for the specified object and returns the index of the last occurrence.
Parameters
object:Object — the object to search for
|
int — the index of the last occurrence of the object
|
listIterator2 | () | method |
override public function listIterator2(location:int):ListIterator
Answers a ListIterator on the elements of this LinkedList. The elements are iterated in the same order that they occur in the LinkedList. The iteration starts at the specified location.
Parameters
location:int — the index at which to start the iteration
|
ListIterator — a ListIterator on the elements of this LinkedList
|
RangeError — when location < 0 || >= size()
|
See also
newLinkedList1 | () | method |
public static function newLinkedList1():LinkedList
Constructs a new empty instance of LinkedList.
ReturnsLinkedList |
newLinkedList2 | () | method |
public static function newLinkedList2(collection:Collection):LinkedList
Constructs a new instance of LinkedList
that holds all of the elements contained in the supplied collection
argument.
The order of the elements in this new LinkedList
will be determined by the iteration order of collection
.
Parameters
collection:Collection — the collection of elements to add
|
LinkedList |
offer | () | method |
public function offer(o:Object):Boolean
Parameters
o:Object |
Boolean |
peek | () | method |
public function peek():Object
ReturnsObject |
poll | () | method |
public function poll():Object
ReturnsObject |
removeFirst | () | method |
public function removeFirst():Object
Removes the first object from this LinkedList.
ReturnsObject — the removed object
|
Error — when this LinkedList is empty
|
removeItem | () | method |
override public function removeItem(object:Object):Boolean
Parameters
object:Object |
Boolean |
removeItemAt | () | method |
override public function removeItemAt(location:int):Object
Removes the object at the specified location from this LinkedList.
Parameters
location:int — the index of the object to remove
|
Object — the removed object
|
RangeError — when location < 0 || >= size()
|
removeLast | () | method |
public function removeLast():Object
Removes the last object from this LinkedList.
ReturnsObject — the removed object
|
Error — when this LinkedList is empty
|
setItemAt | () | method |
override public function setItemAt(location:int, object:Object):Object
Replaces the element at the specified location in this LinkedList with the specified object.
Parameters
location:int — the index at which to put the specified object
| |
object:Object — the object to add
|
Object — the previous element at the index
|
RangeError — when location < 0 || >= size()
|
toArray | () | method |
override public function toArray():Vector.<Object>
Answers a new array containing all elements contained in this LinkedList.
ReturnsVector.<Object> — an array of the elements from this LinkedList
|
toArray2 | () | method |
override public function toArray2(contents:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this LinkedList. If the specified array is large enough to hold the elements, the specified array is used, otherwise an array of the same type is created. If the specified array is used and is larger than this LinkedList, the array element following the collection elements is set to null.
Parameters
contents:Vector.<Object> — the array
|
Vector.<Object> — an array of the elements from this LinkedList
|
Error — when the type of an element in this LinkedList cannot be stored in the type of the specified array
|