![]() |
Documentación GVHIDRA 3.1.5
|
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() |
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.
Definición en la línea 10 del archivo ArrayList.php.
add | ( | $ | element | ) |
Appends the specified element to the end of this list.
public
mixed | $element |
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
ArrayList | $list |
Definición en la línea 59 del archivo ArrayList.php.
ArrayList | ( | $ | elements = array() | ) |
Create an ArrayList with the specified elements.
public
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
mixed | $element |
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
integer | $index |
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
mixed | $element |
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
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
mixed | $element |
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
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
integer | $index |
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
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
integer | $index | |
mixed | $element |
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
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
Definición en la línea 194 del archivo ArrayList.php.
{
return $this->_elements;
}
$_elements = array() |
Definición en la línea 15 del archivo ArrayList.php.