Package bosco :: Module ranking :: Class CachingObject
[hide private]
[frames] | no frames]

Class CachingObject

source code

object --+
         |
        CachingObject

Common parent class for all caching objects.

Instance Methods [hide private]
 
__init__(self, cache=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_from_cache(self, func, obj)
Check cache and return cached result if it exists.
source code
 
_to_cache(self, func, obj, result)
Add result to cache
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cache=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • cache - scoreing cache
Overrides: object.__init__

_from_cache(self, func, obj)

source code 

Check cache and return cached result if it exists.

Parameters:
  • func - function which produced the result
  • obj (object of class RankableItem) - Object of the startegy.

_to_cache(self, func, obj, result)

source code 

Add result to cache

Parameters:
  • func - function which produced the result
  • obj (object of class RankableItem) - Object of the startegy.