org.apache.batik.gvt.font
Class AWTGlyphGeometryCache

java.lang.Object
  extended by org.apache.batik.gvt.font.AWTGlyphGeometryCache

public class AWTGlyphGeometryCache
extends Object

This class represents a doubly indexed hash table, which holds soft references to the contained glyph geometry informations.


Nested Class Summary
protected  class AWTGlyphGeometryCache.Entry
          To manage collisions
static class AWTGlyphGeometryCache.Value
          The object that holds glyph geometry.
 
Field Summary
protected  int count
          The number of entries
protected static int INITIAL_CAPACITY
          The initial capacity
protected  ReferenceQueue referenceQueue
          The reference queue.
protected  AWTGlyphGeometryCache.Entry[] table
          The underlying array
 
Constructor Summary
AWTGlyphGeometryCache()
          Creates a new AWTGlyphGeometryCache.
AWTGlyphGeometryCache(int c)
          Creates a new AWTGlyphGeometryCache.
 
Method Summary
 void clear()
          Clears the table.
 AWTGlyphGeometryCache.Value get(char c)
          Gets the value of a variable
protected  int hashCode(char c)
          Computes a hash code corresponding to the given objects.
 AWTGlyphGeometryCache.Value put(char c, AWTGlyphGeometryCache.Value value)
          Sets a new value for the given variable
protected  void rehash()
          Rehash the table
protected  void removeClearedEntries()
          Removes the cleared entries.
 int size()
          Returns the size of this table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
The initial capacity

See Also:
Constant Field Values

table

protected AWTGlyphGeometryCache.Entry[] table
The underlying array


count

protected int count
The number of entries


referenceQueue

protected ReferenceQueue referenceQueue
The reference queue.

Constructor Detail

AWTGlyphGeometryCache

public AWTGlyphGeometryCache()
Creates a new AWTGlyphGeometryCache.


AWTGlyphGeometryCache

public AWTGlyphGeometryCache(int c)
Creates a new AWTGlyphGeometryCache.

Parameters:
c - The inital capacity.
Method Detail

size

public int size()
Returns the size of this table.


get

public AWTGlyphGeometryCache.Value get(char c)
Gets the value of a variable

Returns:
the value or null

put

public AWTGlyphGeometryCache.Value put(char c,
                                       AWTGlyphGeometryCache.Value value)
Sets a new value for the given variable

Returns:
the old value or null

clear

public void clear()
Clears the table.


rehash

protected void rehash()
Rehash the table


hashCode

protected int hashCode(char c)
Computes a hash code corresponding to the given objects.


removeClearedEntries

protected void removeClearedEntries()
Removes the cleared entries.



Copyright © 2008 Apache Software Foundation. All Rights Reserved.