Packagecom.addicted2flash.util
Classpublic class AbstractLinkedCollection
ImplementsICollection
SubclassesAbstractLinkedList, AbstractLinkedSet, LinkedQueue, LinkedStack

This class provides a skeletal implementation of the ICollection interface for sequential data-structures (linked list) to minimize the effort required to implement this interface.



Public Properties
 PropertyDefined by
  firstNode : LinkedNode
[read-only] return first LinkedNode.
AbstractLinkedCollection
  lastNode : LinkedNode
[read-only] return last LinkedNode.
AbstractLinkedCollection
Protected Properties
 PropertyDefined by
  _first : LinkedNode
AbstractLinkedCollection
  _last : LinkedNode
AbstractLinkedCollection
  _length : int
AbstractLinkedCollection
Public Methods
 MethodDefined by
  
Create a new AbstractLinkedCollection.
AbstractLinkedCollection
  
add(o:*):void
Appends the specified element to the end of this list (optional operation).
AbstractLinkedCollection
  
Adds all of the elements in the specified collection to this collection (optional operation).
AbstractLinkedCollection
  
clear():void
Removes all of the elements from this list (optional operation).
AbstractLinkedCollection
  
Returns a copy of the ICollection.
AbstractLinkedCollection
  
contains(o:*):Boolean
Returns true if this list contains the specified element.
AbstractLinkedCollection
  
Returns true if this collection contains all of the elements in the specified collection.
AbstractLinkedCollection
  
dispose():void
free memory for garbage collection.
AbstractLinkedCollection
  
getAt(i:int):*
Returns the element at the specified position in this collection.
AbstractLinkedCollection
  
return LinkedNode at given index.
AbstractLinkedCollection
  
isEmpty():Boolean
Returns true if this list contains no elements.
AbstractLinkedCollection
  
Returns an iterator over the elements in this list.
AbstractLinkedCollection
  
remove(o:*):Boolean
Removes the first occurrence in this list of the specified element (optional operation).
AbstractLinkedCollection
  
Removes a single instance of the specified element from this collection, if it is present (optional operation)
AbstractLinkedCollection
  
remove LinkedNode.
AbstractLinkedCollection
  
size():int
Returns the number of elements in this list.
AbstractLinkedCollection
  
toArray():Array
Converts the collection into an array.
AbstractLinkedCollection
Property detail
_firstproperty
protected var _first:LinkedNode
firstNodeproperty 
firstNode:LinkedNode  [read-only]

return first LinkedNode.

NOTE: this method should be only used for traversal of the list. It is not recommended to change data with direct access to the nodes.

Implementation
    public function get firstNode():LinkedNode
_lastproperty 
protected var _last:LinkedNode
lastNodeproperty 
lastNode:LinkedNode  [read-only]

return last LinkedNode.

NOTE: this method should be only used for traversal of the list. It is not recommended to change data with direct access to the nodes.

Implementation
    public function get lastNode():LinkedNode
_lengthproperty 
protected var _length:int
Constructor detail
AbstractLinkedCollection()constructor
public function AbstractLinkedCollection()

Create a new AbstractLinkedCollection.

Method detail
add()method
public function add(o:*):void

Appends the specified element to the end of this list (optional operation).

Parameters
o:*
addAll()method 
public function addAll(c:ICollection):void

Adds all of the elements in the specified collection to this collection (optional operation).

Parameters
c:ICollectionCollection containing elements to be added to this collection
clear()method 
public function clear():void

Removes all of the elements from this list (optional operation).

clone()method 
public function clone():ICollection

Returns a copy of the ICollection.

Returns
ICollection — a copy of the ICollection
contains()method 
public function contains(o:*):Boolean

Returns true if this list contains the specified element.

Parameters
o:*

Returns
Boolean — true if this list contains the specified element.
containsAll()method 
public function containsAll(c:ICollection):Boolean

Returns true if this collection contains all of the elements in the specified collection.

Parameters
c:ICollectionCollection collection to be checked for containment in this collection

Returns
Boolean — true if this collection contains all of the elements in the specified collection
dispose()method 
public function dispose():void

free memory for garbage collection.

getAt()method 
public function getAt(i:int):*

Returns the element at the specified position in this collection.

Parameters
i:int — index

Returns
*
getNodeAt()method 
public function getNodeAt(i:int):LinkedNode

return LinkedNode at given index.

Parameters
i:int — index

Returns
LinkedNode — indexed LinkedNode ( null if i >= size() )
isEmpty()method 
public function isEmpty():Boolean

Returns true if this list contains no elements.

Returns
Boolean — true if this list contains no elements.
iterator()method 
public function iterator():IIterator

Returns an iterator over the elements in this list.

Returns
IIterator — IIterator
remove()method 
public function remove(o:*):Boolean

Removes the first occurrence in this list of the specified element (optional operation).

Parameters
o:*

Returns
Boolean — true if this collection changed as a result of the call
removeAll()method 
public function removeAll(c:ICollection):Boolean

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

Parameters
c:ICollectionCollection containing elements to be removed from this collection

Returns
Boolean — true if this collection changed as a result of the call
removeNode()method 
public function removeNode(n:LinkedNode):void

remove LinkedNode.

Parameters
n:LinkedNodeLinkedNode
size()method 
public function size():int

Returns the number of elements in this list.

Returns
int — number of elements in this list.
toArray()method 
public function toArray():Array

Converts the collection into an array.

Returns
Array — an array.