org.sourcejammer.util
Class CachedObjectMasterList

java.lang.Object
  |
  +--org.sourcejammer.util.CachedObjectMasterList

public class CachedObjectMasterList
extends java.lang.Object

Title: Description: Copyright: Copyright (c) 2001 Company:

Version:
1.0
Author:

Field Summary
private static CachedObjectMasterList instance
           
private  boolean mbIsLocked
           
private  CachedListLink mFirst
           
private  int miMaxSize
           
private  int miSize
           
private  CachedListLink mLast
           
private  long mlCachedObjectsFound
           
private  long mlCachedObjectsRequested
           
private  java.lang.String msListKey
           
 
Constructor Summary
private CachedObjectMasterList()
           
private CachedObjectMasterList(int maxSize)
           
 
Method Summary
 CachedListLink append(java.lang.Object o)
           
 void cachedObjectFound()
          Call this when a cached object is accessed to keep a running tab.
 void cachedObjectRequested()
          Call this when a new cached object is created to keep a running tab.
private  void checkLinkSource(CachedListLink l)
           
 long getCachedObjectsFound()
           
 long getCachedObjectsRequested()
           
 double getEfficiencyRating()
          Returns the efficiency rating of all caches using this master list.
static CachedObjectMasterList getInstance()
           
static CachedObjectMasterList getInstance(int maxSize)
           
private static void initInstance(int maxSize)
           
private  void lock()
           
private  CachedListLink makeListLink(java.lang.Object o)
           
 int maxSize()
           
 void moveToBeginning(CachedListLink l)
           
 void moveToEnd(CachedListLink l)
           
 CachedListLink prepend(java.lang.Object o)
           
 void remove(CachedListLink l)
           
private  void setKey()
           
 int size()
           
 java.lang.String toString()
           
private  void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mFirst

private CachedListLink mFirst

mLast

private CachedListLink mLast

msListKey

private java.lang.String msListKey

miSize

private int miSize

mbIsLocked

private boolean mbIsLocked

miMaxSize

private int miMaxSize

mlCachedObjectsRequested

private long mlCachedObjectsRequested

mlCachedObjectsFound

private long mlCachedObjectsFound

instance

private static CachedObjectMasterList instance
Constructor Detail

CachedObjectMasterList

private CachedObjectMasterList()

CachedObjectMasterList

private CachedObjectMasterList(int maxSize)
Method Detail

getInstance

public static CachedObjectMasterList getInstance()

getInstance

public static CachedObjectMasterList getInstance(int maxSize)

initInstance

private static void initInstance(int maxSize)

setKey

private void setKey()

lock

private void lock()

unlock

private void unlock()

remove

public void remove(CachedListLink l)

append

public CachedListLink append(java.lang.Object o)

size

public int size()

maxSize

public int maxSize()

prepend

public CachedListLink prepend(java.lang.Object o)

moveToBeginning

public void moveToBeginning(CachedListLink l)

checkLinkSource

private void checkLinkSource(CachedListLink l)

moveToEnd

public void moveToEnd(CachedListLink l)

makeListLink

private CachedListLink makeListLink(java.lang.Object o)

cachedObjectRequested

public void cachedObjectRequested()
Call this when a new cached object is created to keep a running tab.


getCachedObjectsRequested

public long getCachedObjectsRequested()

cachedObjectFound

public void cachedObjectFound()
Call this when a cached object is accessed to keep a running tab.


getCachedObjectsFound

public long getCachedObjectsFound()

getEfficiencyRating

public double getEfficiencyRating()
Returns the efficiency rating of all caches using this master list. This is the number of times requested requested objects were found in the cache divided by the total number or times items were requested.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2003 Soucejammer project.