Class AbstractList

Description

Implements a mutable list of objects indexed by an integer value

Located in /core/util/AbstractList.class.php (line 39)

PHP2Go
   |
   --AbstractList
Direct descendents
Class Description
ReportSimpleSearch Report simple search processor
Variable Summary
array $elements
int $modCount
Method Summary
AbstractList AbstractList ([array $arr = array()])
bool add (mixed $object, [int $index = -1])
int addAll (array $collection, [int $index = -1])
void clear ()
bool contains (mixed $object)
bool containsAll (array $collection)
mixed &get (int $index)
int getModCount ()
int indexOf (mixed $object)
bool isEmpty ()
int lastIndex ()
int lastIndexOf (mixed $object)
bool remove (int $index)
void removeAll ()
int removeRange (int $fromIndex, int $toIndex)
bool set (int $index, int $object)
int size ()
array subList (int $fromIndex, int $toIndex)
array toArray ()
string __toString ()
Variables
array $elements (line 47)

List elements

  • access: private
int $modCount = 0 (line 55)

Number of list modifications

  • access: private
Methods
Constructor AbstractList (line 63)

Class constructor

AbstractList AbstractList ([array $arr = array()])
  • array $arr: Allows to initialize the list with an array of objects
add (line 91)

Adds an object in the list

If the object already exists in the list, it will be duplicated. If the index exists, all values starting at this index are shifted to the right. The add index must be positive and lower or equal than the list size.

bool add (mixed $object, [int $index = -1])
  • mixed $object: Object to add
  • int $index: Target index
addAll (line 127)

Adds a collection of elements in the list

The add index must be positive and lower or equal than the size of the list. The current indexes of the collection will be ignored.

  • return: Number of added elements
int addAll (array $collection, [int $index = -1])
  • array $collection: Collection of elements
  • int $index: Add index
clear (line 145)

Clears the list

void clear ()
contains (line 182)

Checks if a given object is contained in the list

bool contains (mixed $object)
  • mixed $object: Object
containsAll (line 192)

Checks if all elements of a given collection are contained in the list

bool containsAll (array $collection)
  • array $collection: Collection
get (line 156)

Get an element of the list, given its index

  • return: Element
mixed &get (int $index)
  • int $index: Element's index
getModCount (line 75)

Get the number of modifications since the list was instantiated

int getModCount ()
indexOf (line 210)

Get the index of the first occurence of an object in the list

Returns -1 when the object is not found.

  • return: Index
int indexOf (mixed $object)
  • mixed $object: Object
isEmpty (line 349)

Checks if the list is empty

bool isEmpty ()
iterator (line 171)

Returns an iterator for this list

ListIterator &iterator ()
lastIndex (line 242)

Get the highest index of the list

Returns -1 when the list is empty.

int lastIndex ()
lastIndexOf (line 226)

Get the index of the last occurrence of an object in the list

Returns -1 if the object is not found.

  • return: Index
int lastIndexOf (mixed $object)
  • mixed $object: Object
remove (line 252)

Removes a list element, given its index

bool remove (int $index)
  • int $index: Element's index
removeAll (line 269)

Removes all elements of the list

void removeAll ()
removeRange (line 280)

Removes a set of elements given a range of indexes

  • return: Number of removed elements
int removeRange (int $fromIndex, int $toIndex)
  • int $fromIndex: Start index
  • int $toIndex: End index
set (line 305)

Redefine a member of the list, given its index

bool set (int $index, int $object)
  • int $index: Element's index
  • int $object: New value
size (line 340)

Get the current list size

int size ()
subList (line 322)

Builds a subset of elements, given a range of indexes

  • return: Subset of elements
array subList (int $fromIndex, int $toIndex)
  • int $fromIndex: Start index
  • int $toIndex: End index
toArray (line 358)

Builds an array representation of the list

array toArray ()
__toString (line 367)

Builds a string representation of the list

string __toString ()

Redefinition of:
PHP2Go::__toString()
Generate a string representation of the object

Inherited Methods

Inherited From PHP2Go

PHP2Go::PHP2Go()
PHP2Go::equals()
PHP2Go::generateUniqueId()
PHP2Go::getClassName()
PHP2Go::getConfigVal()
PHP2Go::getLangVal()
PHP2Go::getObjectName()
PHP2Go::getParentName()
PHP2Go::hasDestructor()
PHP2Go::hashCode()
PHP2Go::isA()
PHP2Go::isSubclassOf()
PHP2Go::logError()
PHP2Go::raiseError()
PHP2Go::registerDestructor()
PHP2Go::registerShutdownFunc()
PHP2Go::retrieve()
PHP2Go::store()
PHP2Go::__toString()

Documentation generated on Sun, 07 Oct 2007 19:19:40 -0300 by phpDocumentor 1.3.2