Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.imagero.uio.buffer
Class MemoryAccessManager  view MemoryAccessManager download MemoryAccessManager.java

java.lang.Object
  extended bycom.imagero.uio.buffer.MemoryAccessManager
Direct Known Subclasses:
MemoryAccessManager.DIMemoryAccessManager, MemoryAccessManager.DNMemoryAccessManager, MemoryAccessManager.DRMemoryAccessManager, MemoryAccessManager.FIFOMemoryAccessManager, MemoryAccessManager.LRUMemoryAccessManager

public abstract class MemoryAccessManager
extends java.lang.Object

MemoryAccessManager. Implements 5 possible strategies to free memory: - DROP_NEVER - Buffer(s) are never dropped - DROP_IMMEDIATELY - only 1 Buffer is held in memory - DROP_RANDOM - if buffer count exceeds maxBufferCount then randomly choosed Buffer is dropped - DROP_LRU - if buffer count exceeds maxBufferCount then Least Recently Used Buffer is dropped - DROP_FIFO - if buffer count exceeds maxBufferCount then Least Recently Added Buffer is dropped


Nested Class Summary
(package private) static class MemoryAccessManager.DIMemoryAccessManager
           
(package private) static class MemoryAccessManager.DNMemoryAccessManager
           
(package private) static class MemoryAccessManager.DRMemoryAccessManager
           
(package private) static class MemoryAccessManager.FIFOMemoryAccessManager
           
(package private) static class MemoryAccessManager.LRUMemoryAccessManager
           
 
Field Summary
private static int defaultStrategy
           
static int DROP_FIFO
           
static int DROP_IMMEDIATELY
           
static int DROP_LRU
           
static int DROP_NEVER
           
static int DROP_RANDOM
           
(package private)  IHashtable ht
           
(package private)  int maxBufferCount
           
 
Constructor Summary
MemoryAccessManager()
           
 
Method Summary
 void add(Buffer b)
           
 void clear()
           
static MemoryAccessManager createMemoryAccessManager()
           
static MemoryAccessManager createMemoryAccessManager(int strategy)
           
 Buffer drop(java.lang.Integer key)
           
 Buffer get(int i)
           
abstract  Buffer get(java.lang.Integer key)
           
 int getBufferLength(int i)
           
 int getBufferLength(java.lang.Integer key)
           
 int getCount()
           
static int getDefaultStrategy()
           
 int getMaxBufferCount()
           
 boolean isDirty(int index)
           
 boolean isDirty(java.lang.Integer key)
           
 java.util.Enumeration keys()
           
abstract  void put(java.lang.Integer key, Buffer b)
           
static void setDefaultStrategy(int defaultStrategy)
           
 void setMaxBufferCount(int maxBufferCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DROP_NEVER

public static final int DROP_NEVER
See Also:
Constant Field Values

DROP_IMMEDIATELY

public static final int DROP_IMMEDIATELY
See Also:
Constant Field Values

DROP_RANDOM

public static final int DROP_RANDOM
See Also:
Constant Field Values

DROP_LRU

public static final int DROP_LRU
See Also:
Constant Field Values

DROP_FIFO

public static final int DROP_FIFO
See Also:
Constant Field Values

defaultStrategy

private static int defaultStrategy

maxBufferCount

int maxBufferCount

ht

IHashtable ht
Constructor Detail

MemoryAccessManager

public MemoryAccessManager()
Method Detail

getDefaultStrategy

public static int getDefaultStrategy()

setDefaultStrategy

public static void setDefaultStrategy(int defaultStrategy)

createMemoryAccessManager

public static MemoryAccessManager createMemoryAccessManager()

createMemoryAccessManager

public static MemoryAccessManager createMemoryAccessManager(int strategy)

get

public abstract Buffer get(java.lang.Integer key)

put

public abstract void put(java.lang.Integer key,
                         Buffer b)

add

public void add(Buffer b)

get

public Buffer get(int i)

getCount

public int getCount()

getBufferLength

public int getBufferLength(int i)

getBufferLength

public int getBufferLength(java.lang.Integer key)

drop

public Buffer drop(java.lang.Integer key)

getMaxBufferCount

public int getMaxBufferCount()

setMaxBufferCount

public void setMaxBufferCount(int maxBufferCount)

clear

public void clear()

isDirty

public boolean isDirty(int index)

isDirty

public boolean isDirty(java.lang.Integer key)

keys

public java.util.Enumeration keys()