org.openstreetmap.gui.jmapviewer
Class MemoryTileCache.CacheLinkedListElement

java.lang.Object
  extended by org.openstreetmap.gui.jmapviewer.MemoryTileCache.CacheLinkedListElement
Enclosing class:
MemoryTileCache

protected static class MemoryTileCache.CacheLinkedListElement
extends java.lang.Object

Special implementation of a double linked list for MemoryTileCache.CacheEntry elements. It supports element removal in constant time - in difference to the Java implementation which needs O(n).


Field Summary
protected  int elementCount
           
protected  MemoryTileCache.CacheEntry firstElement
           
protected  MemoryTileCache.CacheEntry lastElement
           
 
Constructor Summary
MemoryTileCache.CacheLinkedListElement()
           
 
Method Summary
 void addFirst(MemoryTileCache.CacheEntry element)
          Add the element to the head of the list.
 void clear()
           
 int getElementCount()
           
 MemoryTileCache.CacheEntry getFirstElement()
           
 MemoryTileCache.CacheEntry getLastElement()
           
 void moveElementToFirstPos(MemoryTileCache.CacheEntry entry)
           
 void removeEntry(MemoryTileCache.CacheEntry element)
          Removes the specified element from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

firstElement

protected MemoryTileCache.CacheEntry firstElement

lastElement

protected MemoryTileCache.CacheEntry lastElement

elementCount

protected int elementCount
Constructor Detail

MemoryTileCache.CacheLinkedListElement

public MemoryTileCache.CacheLinkedListElement()
Method Detail

clear

public void clear()

addFirst

public void addFirst(MemoryTileCache.CacheEntry element)
Add the element to the head of the list.

Parameters:
element - new element to be added

removeEntry

public void removeEntry(MemoryTileCache.CacheEntry element)
Removes the specified element from the list.

Parameters:
element - element to be removed

moveElementToFirstPos

public void moveElementToFirstPos(MemoryTileCache.CacheEntry entry)

getElementCount

public int getElementCount()

getLastElement

public MemoryTileCache.CacheEntry getLastElement()

getFirstElement

public MemoryTileCache.CacheEntry getFirstElement()


JOSM