Sgss_Collection_Set_Interface 
Provides for collection without duplicated element

Description

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

Class overview

Methods

boolean add (mixed $element)

Adds the specified element in this set

boolean addAll (array|object $t)

Adds all the elements in the specified object in this set

boolean clear ()

Removes all the elements in this set

boolean has (mixed $element)

Determines whether this set contains the specified element

boolean hasAll (array|object $t)

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

boolean isEmpty ()

Determines whether this set contains no element

boolean remove (mixed $element)

Removes the element from this set

boolean removeAll (array|object $t)

Removes all the elements in the specified object from this set

int size ()

Returns the number of elements in this set

array toArray ()

Converts this set to an array

Method detail

add

Adds the specified element in this set

Parameters:
  • mixed $element

    Element to be added

Returns:
boolean -- True when the operation changed this set
Used by:
Sgss_Collection_Set_Abstract::addAll()
Signature:
public boolean add (mixed $element)


addAll

Adds all the elements in the specified object in this set

Parameters:
  • array|object $t

    Object containing the elements to be added

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


clear

Removes all the elements in this set

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


has

Determines whether this set contains the specified element

Parameters:
  • mixed $element

    Element to determine

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


hasAll

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

Parameters:
  • array|object $t

    Object containing the elements to determine

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


isEmpty

Determines whether this set contains no element

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


remove

Removes the element from this set

Parameters:
  • mixed $element

    Element to be removed

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


removeAll

Removes all the elements in the specified object from this set

Parameters:
  • array|object $t

    Object containing the elements to be removed

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


size

Returns the number of elements in this set

Returns:
int -- The number of elements in this set
Used by:
Sgss_Collection_Set_Abstract::count(), Sgss_Collection_Set_Abstract::isEmpty()
Signature:
public int size ()


toArray

Converts this set to an array

Returns:
array -- Array representing this set
Signature:
public array toArray ()