Sgss_Collection_List_Interface 
Provides for indexed collection

Description

Author:
Matsuda Shota
Copyright:
(c) 2007-2008 Matsuda Shota
License:
http://creativecommons.org/licenses/GPL/2.0/
Located in:
/Collection/List/Interface.php (line 40)

Class overview

Methods

boolean add (mixed $element)

Appends the specified element at the end of this list

boolean addAll (array|object $t)

Appends all the elements in the specified object at the end of this list

boolean clear ()

Removes all the indices and elements in this list

mixed drop (int $index)

Removes the specified index and the corresponding element from this list

mixed get (int $index)

Returns the element at the specified index of this list

boolean has (mixed $element)

Determines whether this list contains the specified element

boolean hasAll (array|object $t)

Determines whether this list contains all the elements in the specified object

int index (mixed $element)

Returns the index at which the specified element first appears in this list

boolean insert (int $index, mixed $element)

Inserts or appends the specified element at the specified index of this list

boolean insertAll (int $index, array|object $t)

Inserts or appends all the elements in the specified object at the specified index

boolean isEmpty ()

Determines whether this list contains no element

boolean remove (mixed $element)

Removes the specified element from this list

boolean removeAll (array|object $t)

Removes all the elements in the specified object from this list

mixed set (int $index, mixed $element)

Replaces the element at the specified index of this list to the specified element

int size ()

Returns the number of elements in this list

array toArray ()

Converts this list to an associated array

Method detail

add

Appends the specified element at the end of this list

Parameters:
  • mixed $element

    Element to be appended

Returns:
boolean -- True when the operation changed this list
Used by:
Sgss_Collection_List_Abstract::offsetSet(), Sgss_Collection_List_Abstract::addAll()
Signature:
public boolean add (mixed $element)


addAll

Appends all the elements in the specified object at the end of this list

Parameters:
  • array|object $t

    Object containing elements to be appended

Returns:
boolean -- True when the operation changed this list
Signature:
public boolean addAll (array|object $t)


clear

Removes all the indices and elements in this list

Returns:
boolean -- True when the operation changed this list
Signature:
public boolean clear ()


drop

Removes the specified index and the corresponding element from this list

Parameters:
  • int $index

    Index to be removed

Returns:
mixed -- The element previously stored at the specified index
Used by:
Sgss_Collection_List_Abstract::offsetUnset()
Signature:
public mixed drop (int $index)


get

Returns the element at the specified index of this list

Parameters:
  • int $index

    Index of element to be retrieved

Returns:
mixed -- The element stored at the specified index
Used by:
Sgss_Font_Panose_Abstract::current(), Sgss_Collection_List_Iterator::current(), Sgss_Collection_List_Abstract::current(), Sgss_Collection_List_Abstract::offsetGet()
Signature:
public mixed get (int $index)


has

Determines whether this list contains the specified element

Parameters:
  • mixed $element

    Element to determine

Returns:
boolean -- True when this list contains the specified element
Used by:
Sgss_Collection_List_Abstract::hasAll()
Signature:
public boolean has (mixed $element)


hasAll

Determines whether this list contains all the elements in the specified object

Parameters:
  • array|object $t

    Object containing elements to determine

Returns:
boolean -- True when this list contains the all the element in the specified object
Signature:
public boolean hasAll (array|object $t)


index

Returns the index at which the specified element first appears in this list

Parameters:
  • mixed $element

    Element to search

Returns:
int -- The index at which the specified element first appears, or -1 if this list does not contains it
Signature:
public int index (mixed $element)


insert

Inserts or appends the specified element at the specified index of this list

Parameters:
  • int $index

    Index to insert at

  • mixed $element

    Element to be inserted or appended

Returns:
boolean -- True when the operation changed this list
Used by:
Sgss_Collection_List_Abstract::insertAll()
Signature:
public boolean insert (int $index, mixed $element)


insertAll

Inserts or appends all the elements in the specified object at the specified index

Parameters:
  • int $index

    Index to insert at

  • array|object $t

    Object containing elements to be inserted

Returns:
boolean -- True when the operation changed this list
Signature:
public boolean insertAll (int $index, array|object $t)


isEmpty

Determines whether this list contains no element

Returns:
boolean -- True when this list contains no element
Signature:
public boolean isEmpty ()


remove

Removes the specified element from this list

Parameters:
  • mixed $element

    Element to be removed

Returns:
boolean -- True when the operation changed this list
Used by:
Sgss_Collection_List_Abstract::removeAll()
Signature:
public boolean remove (mixed $element)


removeAll

Removes all the elements in the specified object from this list

Parameters:
  • array|object $t

    Object containing the elements to be removed

Returns:
boolean -- True when the operation changed this list
Signature:
public boolean removeAll (array|object $t)


set

Replaces the element at the specified index of this list to the specified element

Parameters:
  • int $index

    Index of element to be replaced

  • mixed $element

    Element to store

Returns:
mixed -- The element previously stored at the specified index
Used by:
Sgss_Collection_List_Abstract::offsetSet()
Signature:
public mixed set (int $index, mixed $element)


size

Returns the number of elements in this list

Returns:
int -- The number of elements in this list
Used by:
Sgss_Collection_List_Iterator::valid(), Sgss_Font_Panose_Abstract::valid(), Sgss_Collection_List_Abstract::valid(), Sgss_Collection_List_Abstract::offsetExists(), Sgss_Collection_List_Abstract::isEmpty(), Sgss_Collection_List_Abstract::count()
Signature:
public int size ()


toArray

Converts this list to an associated array

Returns:
array -- An associated array which represents this list
Signature:
public array toArray ()