Class FTCache_Strategy_DirectMapping

(line 523)

Description

FTCache_Strategy
   |
   --FTCache_Strategy_DirectMapping

Located in File: /FTCache.php

Implements a Direct Mapping strategy between the given object id and the cache index id by doing a modulus using the size of the cache.


Class Variables

Summary:

Class Constants

Summary:

Method Detail

Summary:
int fromCache (int $index)
void stored (int $id)
int toCache (int $id)

Method fromCache (line 540)

int fromCache( int $index)

Overrides : FTCache_Strategy::fromCache() Convert a cache entry index into an object id

Convert a cache entry index into an object id

This method must return the object id of the cache entry stored at the given index. If there is nothing stored there, then it must return false.

Parameters

  • int $index: Cache entry index

Info

  • return - Object Id. False if we can't map that index or nothing is stored there.
  • access - public

Method stored (line 553)

void stored( int $id)

Overrides : FTCache_Strategy::stored() Whenever the cache will store an object in the container, it informs this strategy object by calling this method.

Whenever the cache will store an object in the container, it informs this strategy object by calling this method.

Parameters

  • int $id: Object id

Info

  • access - public

Method toCache (line 575)

int toCache( int $id)

Overrides : FTCache_Strategy::toCache() Convert an object ID into a cache entry index.

Convert an object ID into a cache entry index.

This method must return the index that the given object id is stored at if it is currently stored, or the index that it will be stored at if it is not already stored.

Parameters

  • int $id: Object ID

Info

  • return - Cache Index. False if we can't / won't map that index
  • access - public

Inherited Variables

Inherited Class Variable Summary

Inherited From Class FTCache_Strategy

FTCache_Strategy::$_size - Size of the schema, used for the modulus

Inherited Methods

Inherited Method Summary

Inherited From Class FTCache_Strategy

FTCache_Strategy::__construct() - Sets the size of the cache.

FTCache_Strategy::fromCache() - Convert a cache entry index into an object id

FTCache_Strategy::stored() - Whenever the cache will store an object in the container, it informs this strategy object by calling this method.

FTCache_Strategy::toCache() - Convert an object ID into a cache entry index.



Documentation generated on Sat, 01 Mar 2008 03:16:45 +0000 by phpDocumentor 1.4.0