jeroen.util
Class ListCache

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--jeroen.util.ListCache
All Implemented Interfaces:
Collection, List

public class ListCache
extends AbstractList


Field Summary
static int CLUSTERCACHE
          Deze constante geeft aan dat de cache geoptimaliseerd moet worden voor sequentiële toegang.
static int HARDCACHE
          Deze constante geeft aan dat alle films die ooit opgevraagd zijn in het geheugen moeten blijven staan.
static int NOCACHE
          Deze constante geeft aan dat de cache uitgeschakeld moet worden.
static int SOFTCACHE
          Deze constante geeft aan dat er m.b.v.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ListCache(int grootte, int mode)
           
ListCache(int grootte, int mode, int blokGrootte)
           
 
Method Summary
 Object get(int index)
           
 Object set(int index, Object element)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

NOCACHE

public static final int NOCACHE
Deze constante geeft aan dat de cache uitgeschakeld moet worden.
See Also:
#setCacheMode(int)

SOFTCACHE

public static final int SOFTCACHE
Deze constante geeft aan dat er m.b.v. SoftReferences gecached moet worden. Deze methode houdt de films in het geheugen, totdat het geheugen vol is, en dan wordt de hele cache gewist. .SoftReference
See Also:
#setCacheMode(int), java.lang.ref.SoftReference, String, HashComparator, Film, RandomAccessFile, java.io.RandomAccessFile, Venster

HARDCACHE

public static final int HARDCACHE
Deze constante geeft aan dat alle films die ooit opgevraagd zijn in het geheugen moeten blijven staan. Gebruik deze optie alleen als het om weinig films gaat, of als je een enorme hoeveelheid geheugen hebt. (en natuurlijk ook de heapsize m.b.v. -mx vergroot hebt!!)
See Also:
#setCacheMode(int)

CLUSTERCACHE

public static final int CLUSTERCACHE
Deze constante geeft aan dat de cache geoptimaliseerd moet worden voor sequentiële toegang. Gebruik deze methode als je de database van A tot Z gaat opvragen. (of, zoals je wilt, van 0 tot size()...)
See Also:
#setCacheMode(int)
Constructor Detail

ListCache

public ListCache(int grootte,
                 int mode)

ListCache

public ListCache(int grootte,
                 int mode,
                 int blokGrootte)
Method Detail

size

public int size()
Overrides:
size in class AbstractCollection

get

public Object get(int index)
Overrides:
get in class AbstractList

set

public Object set(int index,
                  Object element)
Overrides:
set in class AbstractList