Documentación GVHIDRA 3.1.5
Referencia de la Clase ArrayList
Diagrama de herencias de ArrayList
Object Stack

Métodos públicos

 ArrayList ($elements=array())
 listIterator ()
 add ($element)
 addAll ($list)
 clear ()
 contains ($element)
 get ($index)
 indexOf ($element)
 isEmpty ()
 lastIndexOf ($element)
 remove ($index)
 removeRange ($start, $end)
 set ($index, $element)
 size ()
 toArray ()

Campos de datos

 $_elements = array()

Descripción detallada

ArrayList of objects that can be administered and searched, while hiding the internal implementation. This is an implementation of the ArrayList class in the Java language.

Autor:
Arnold Cano
Versión:
Id:
ArrayList.php,v 1.1.1.1 2004-06-16 12:25:44 cvs Exp

Definición en la línea 10 del archivo ArrayList.php.


Documentación de las funciones miembro

add ( element)

Appends the specified element to the end of this list.

public

Parámetros:
mixed$element
Devuelve:
boolean

Definición en la línea 46 del archivo ArrayList.php.

        {
                return (array_push($this->_elements, $element)) ? TRUE : FALSE;
        }
addAll ( list)

Appends all of the elements in the specified ArrayList to the end of this list, in the order that they are returned by the specified ArrayList's ListIterator.

public

Parámetros:
ArrayList$list
Devuelve:
boolean

Definición en la línea 59 del archivo ArrayList.php.

        {
                $before = $this->size();
                if (is_a($list, get_class($this))) {
                        $iterator = $list->listIterator();
                        while ($iterator->hasNext()) {
                                $this->add($iterator->next());
                        }
                }
                $after = $this->size();
                return ($before < $after);
        }
ArrayList ( elements = array())

Create an ArrayList with the specified elements.

public

Parámetros:
string$elements

Definición en la línea 23 del archivo ArrayList.php.

        {
                if (!empty($elements)) {
                        $this->_elements = $elements;
                }
        }
clear ( )

Removes all of the elements from this list.

public

Definición en la línea 76 del archivo ArrayList.php.

        {
                $this->_elements = array();
        }
contains ( element)

Returns true if this list contains the specified element.

public

Parámetros:
mixed$element
Devuelve:
boolean

Definición en la línea 87 del archivo ArrayList.php.

        {
                return (array_search($element, $this->_elements)) ? TRUE : FALSE;
        }
get ( index)

Returns the element at the specified position in this list.

public

Parámetros:
integer$index
Devuelve:
mixed

Definición en la línea 98 del archivo ArrayList.php.

        {
                return $this->_elements[$index];
        }
indexOf ( element)

Searches for the first occurence of the given argument.

public

Parámetros:
mixed$element
Devuelve:
mixed

Definición en la línea 109 del archivo ArrayList.php.

        {
                return array_search($element, $this->_elements);
        }
isEmpty ( )

Tests if this list has no elements.

public

Devuelve:
boolean

Definición en la línea 119 del archivo ArrayList.php.

        {
                return empty($this->_values);
        }
lastIndexOf ( element)

Returns the index of the last occurrence of the specified object in this list.

public

Parámetros:
mixed$element
Devuelve:
mixed

Definición en la línea 131 del archivo ArrayList.php.

        {
                for ($i = (count($this->_elements) - 1); $i > 0; $i--) {
                        if ($element == $this->get($i)) { return $i; }
                }
        }
listIterator ( )

Get a ListIterator for the ArrayList.

public

Devuelve:
ListIterator

Definición en la línea 35 del archivo ArrayList.php.

        {
                return new ListIterator($this->_elements);
        }
remove ( index)

Removes the element at the specified position in this list.

public

Parámetros:
integer$index
Devuelve:
mixed

Definición en la línea 144 del archivo ArrayList.php.

        {
                $element = $this->get($index);
                if (!is_null($element)) { array_splice($this->_elements, $index, 1); }
                return $element;
        }
removeRange ( start,
end 
)

Removes from this List all of the elements whose index is between start, inclusive and end, exclusive.

public

Parámetros:
integer$start
integer$end

Definición en la línea 158 del archivo ArrayList.php.

        {
                array_splice($this->_elements, $start, $end);
        }
set ( index,
element 
)

Replaces the element at the specified position in this list with the specified element.

public

Parámetros:
integer$index
mixed$element
Devuelve:
mixed

Definición en la línea 171 del archivo ArrayList.php.

        {
                $previous = $this->get($index);
                $this->_elements[$index] = $element;
                return $previous;
        }
size ( )

Returns the number of elements in this list.

public

Devuelve:
integer

Definición en la línea 183 del archivo ArrayList.php.

        {
                return count($this->_elements);
        }
toArray ( )

Returns an array containing all of the elements in this list in the correct order.

public

Devuelve:
array

Definición en la línea 194 del archivo ArrayList.php.

        {
                return $this->_elements;
        }

Documentación de los campos

$_elements = array()

Definición en la línea 15 del archivo ArrayList.php.


La documentación para esta clase fue generada a partir del siguiente fichero: