Java Doc for Cache.java in  » Database-ORM » MMBase » org » mmbase » cache » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.cache 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.cache.Cache

Cache
abstract public class Cache implements SizeMeasurable,Map<K, V>(Code)
A base class for all Caches. Extend this class for other caches.
author:
   Michiel Meeuwissen
version:
   $Id: Cache.java,v 1.49 2008/02/03 17:33:56 nklasens Exp $


Field Summary
protected  intmaxEntrySize
    

Constructor Summary
public  Cache(int size)
    

Method Summary
protected  booleancheckCachePolicy(Object key)
     Checks whether the key object should be cached.
public  voidclear()
    
public  booleancontains(Object key)
    
public  booleancontainsKey(Object key)
    
public  booleancontainsValue(Object value)
    
public  Set<Map.Entry<K, V>>entrySet()
    
public  booleanequals(Object o)
    
public  Vget(Object key)
     Like 'get' of Maps but considers if the cache is active or not, and the cache policy of the key.
public  intgetByteSize()
    
public  intgetByteSize(SizeOf sizeof)
    
public  intgetCheapByteSize()
     Returns the sum of bytesizes of every key and value.
public  intgetCount(K key)
    
protected  intgetDefaultMaxEntrySize()
     This has to be overridden by Caches which support max entry size.
public  StringgetDescription()
     Gives a description for this cache type.
public  longgetHits()
     Returns the number of times an element was succesfully retrieved from the table.
public  intgetMaxEntrySize()
     Return the maximum entry size for the cache in bytes.
public  longgetMisses()
     Returns the number of times an element cpould not be retrieved from the table.
public  StringgetName()
     Returns a name for this cache type.
public  longgetPuts()
     Returns the number of times an element was committed to the table.
public  doublegetRatio()
     Returns the ratio of hits and misses.
public  StringgetStats()
     Returns statistics on this table.
public  inthashCode()
    
final public  booleanisActive()
     Wether this cache is active or not.
public  booleanisEmpty()
    
public  Set<K>keySet()
    
public  intmaxSize()
    
public  Vput(K key, V value)
     Like 'put' of LRUHashtable but considers if the cache is active or not.
public  voidputAll(Map<? extends K, ? extends V> t)
    
public  Cache<K, V>putCache()
     Puts this cache in the caches repository.
public  Vremove(Object key)
    
public  voidsetActive(boolean a)
     Sets this cache to active or passive.
 voidsetImplementation(String clazz, Map<String, String> configValues)
    
public  voidsetMaxSize(int size)
    
public  intsize()
    
public  StringtoString()
    
public  Collection<V>values()
    

Field Detail
maxEntrySize
protected int maxEntrySize(Code)




Constructor Detail
Cache
public Cache(int size)(Code)




Method Detail
checkCachePolicy
protected boolean checkCachePolicy(Object key)(Code)
Checks whether the key object should be cached. This method returns false if either the current cache is inactive, or the object to cache has a cache policy associated that prohibits caching of the object.
Parameters:
  key - the object to be cached true if the object can be cached
since:
   MMBase-1.8



clear
public void clear()(Code)

See Also:   java.util.Map.clear



contains
public boolean contains(Object key)(Code)



containsKey
public boolean containsKey(Object key)(Code)

See Also:   java.util.Map.containsKey(java.lang.Object)



containsValue
public boolean containsValue(Object value)(Code)

See Also:   java.util.Map.containsValue(java.lang.Object)



entrySet
public Set<Map.Entry<K, V>> entrySet()(Code)



equals
public boolean equals(Object o)(Code)

See Also:   java.util.Map.equals(java.lang.Object)



get
public V get(Object key)(Code)
Like 'get' of Maps but considers if the cache is active or not, and the cache policy of the key.



getByteSize
public int getByteSize()(Code)



getByteSize
public int getByteSize(SizeOf sizeof)(Code)



getCheapByteSize
public int getCheapByteSize()(Code)
Returns the sum of bytesizes of every key and value. This may count too much, because objects (like Nodes) may occur in more then one value, but this is considerably cheaper then Cache.getByteSize() , which has to keep a Collection of every counted object.
since:
   MMBase-1.8



getCount
public int getCount(K key)(Code)



getDefaultMaxEntrySize
protected int getDefaultMaxEntrySize()(Code)
This has to be overridden by Caches which support max entry size.



getDescription
public String getDescription()(Code)
Gives a description for this cache type. This can be used in cache overviews.



getHits
public long getHits()(Code)
Returns the number of times an element was succesfully retrieved from the table.



getMaxEntrySize
public int getMaxEntrySize()(Code)
Return the maximum entry size for the cache in bytes. If the cache-type supports it (default no), then no values bigger then this will be stored in the cache.



getMisses
public long getMisses()(Code)
Returns the number of times an element cpould not be retrieved from the table.



getName
public String getName()(Code)
Returns a name for this cache type. Default it is the class name, but this normally will be overriden.



getPuts
public long getPuts()(Code)
Returns the number of times an element was committed to the table.



getRatio
public double getRatio()(Code)
Returns the ratio of hits and misses. The higher the ratio, the more succesfull the table retrieval is. A value of 1 means every attempt to retrieve data is succesfull, while a value nearing 0 means most times the object requested it is not available. Generally a high ratio means the table can be shrunk, while a low ratio means its size needs to be increased. A double between 0 and 1 or NaN.



getStats
public String getStats()(Code)
Returns statistics on this table. The information shown includes number of accesses, ratio of misses and hits, current size, and number of puts.



hashCode
public int hashCode()(Code)

See Also:   java.util.Map.hashCode



isActive
final public boolean isActive()(Code)
Wether this cache is active or not.



isEmpty
public boolean isEmpty()(Code)

See Also:   java.util.Map.isEmpty



keySet
public Set<K> keySet()(Code)

See Also:   java.util.Map.keySet



maxSize
public int maxSize()(Code)



put
public V put(K key, V value)(Code)
Like 'put' of LRUHashtable but considers if the cache is active or not.



putAll
public void putAll(Map<? extends K, ? extends V> t)(Code)

See Also:   java.util.Map.putAll(java.util.Map)



putCache
public Cache<K, V> putCache()(Code)
Puts this cache in the caches repository.
See Also:   CacheManager.putCache(Cache)



remove
public V remove(Object key)(Code)

See Also:   java.util.Map.remove(java.lang.Object)



setActive
public void setActive(boolean a)(Code)
Sets this cache to active or passive. TODO: Writing back to caches.xml if necessary (if this call was nog caused by change of caches.xml itself)



setImplementation
void setImplementation(String clazz, Map<String, String> configValues)(Code)



setMaxSize
public void setMaxSize(int size)(Code)



size
public int size()(Code)

See Also:   java.util.Map.size



toString
public String toString()(Code)



values
public Collection<V> values()(Code)

See Also:   java.util.Map.values



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.