PHP Class AppserverIo\Appserver\PersistenceContainer\StatefulSessionBeanMap

Inheritance: extends AppserverIo\Storage\GenericStackable, implements AppserverIo\Collections\MapInterface
Show file Open project: appserver-io/appserver

Protected Properties

Property Type Description
$items AppserverIo\Storage\GenericStackable The items the map contains.
$lifetime AppserverIo\Storage\GenericStackable Array containing the lifetime of the items.

Public Methods

Method Description
__construct ( ) Initializes the map.
add ( mixed $key, mixed $object, integer $lifetime ) : null This method adds the passed object with the passed key to the instance.
addAll ( array $array ) : AppserverIo\Collections\CollectionInterface This method appends all elements of the passed array to the Collection.
clear ( ) : void This method initializes the Collection and removes all exsiting entries.
exists ( mixed $key ) : boolean This method checks if the element with the passed key exists in the Collection.
get ( mixed $key ) : mixed This method returns the element with the passed key from the Collection.
getLifetime ( ) : array Returns the lifetime of the items the instance contains.
isEmpty ( ) : boolean This returns true if the Collection has no entries, otherwise false.
remove ( mixed $key, callable $beforeRemove = null ) : void This method removes the element with the passed key, that has to be an integer, from the IndexedCollection.
size ( ) : integer This method returns the number of entries of the Collection.
toArray ( ) : array This method returns an array with the items of the Dictionary.
toIndexedArray ( ) : array This method returns the internal array with the keys and the related values.

Protected Methods

Method Description
isTimedOut ( mixed $key ) : boolean Returns TRUE if an lifetime value for the passed key is available and the item has timed out.

Method Details

__construct() public method

Initializes the map.
public __construct ( )

add() public method

This method adds the passed object with the passed key to the instance.
public add ( mixed $key, mixed $object, integer $lifetime ) : null
$key mixed The key to add the passed value under
$object mixed The object to add to the instance
$lifetime integer The items lifetime
return null

addAll() public method

This method appends all elements of the passed array to the Collection.
public addAll ( array $array ) : AppserverIo\Collections\CollectionInterface
$array array Holds the array with the values to add
return AppserverIo\Collections\CollectionInterface The instance

clear() public method

This method initializes the Collection and removes all exsiting entries.
public clear ( ) : void
return void

exists() public method

This method checks if the element with the passed key exists in the Collection.
public exists ( mixed $key ) : boolean
$key mixed Holds the key to check the elements of the Collection for
return boolean Returns true if an element with the passed key exists in the Collection

get() public method

This method returns the element with the passed key from the Collection.
public get ( mixed $key ) : mixed
$key mixed Holds the key of the element to return
return mixed The requested element

getLifetime() public method

Returns the lifetime of the items the instance contains.
public getLifetime ( ) : array
return array The array with the items and their lifetime

isEmpty() public method

This returns true if the Collection has no entries, otherwise false.
public isEmpty ( ) : boolean
return boolean

isTimedOut() protected method

Returns TRUE if an lifetime value for the passed key is available and the item has timed out.
protected isTimedOut ( mixed $key ) : boolean
$key mixed The key of the item the lifetime check is requested
return boolean TRUE if the item has timed out, else FALSE

remove() public method

This method removes the element with the passed key, that has to be an integer, from the IndexedCollection.
public remove ( mixed $key, callable $beforeRemove = null ) : void
$key mixed Holds the key of the element to remove
$beforeRemove callable Is called before the item will be removed
return void

size() public method

This method returns the number of entries of the Collection.
public size ( ) : integer
return integer The number of entries

toArray() public method

The keys are lost in the array.
public toArray ( ) : array
return array Holds an array with the items of the Dictionary

toIndexedArray() public method

This method returns the internal array with the keys and the related values.
See also: AppserverIo\Collections\Map::toIndexedArray()
public toIndexedArray ( ) : array
return array Holds the array with keys and values

Property Details

$items protected property

The items the map contains.
protected GenericStackable,AppserverIo\Storage $items
return AppserverIo\Storage\GenericStackable

$lifetime protected property

Array containing the lifetime of the items.
protected GenericStackable,AppserverIo\Storage $lifetime
return AppserverIo\Storage\GenericStackable