org.apache.batik.gvt.font

Class 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 classAWTGlyphGeometryCache.Entry
To manage collisions
static classAWTGlyphGeometryCache.Value
The object that holds glyph geometry.
Field Summary
protected intcount
The number of entries
protected static intINITIAL_CAPACITY
The initial capacity
protected ReferenceQueuereferenceQueue
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
voidclear()
Clears the table.
AWTGlyphGeometryCache.Valueget(char c)
Gets the value of a variable
protected inthashCode(char c)
Computes a hash code corresponding to the given objects.
AWTGlyphGeometryCache.Valueput(char c, AWTGlyphGeometryCache.Value value)
Sets a new value for the given variable
protected voidrehash()
Rehash the table
protected voidremoveClearedEntries()
Removes the cleared entries.
intsize()
Returns the size of this table.

Field Detail

count

protected int count
The number of entries

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
The initial capacity

referenceQueue

protected ReferenceQueue referenceQueue
The reference queue.

table

protected AWTGlyphGeometryCache.Entry[] table
The underlying array

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

clear

public void clear()
Clears the table.

get

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

Returns: the value or null

hashCode

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

put

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

Returns: the old value or null

rehash

protected void rehash()
Rehash the table

removeClearedEntries

protected void removeClearedEntries()
Removes the cleared entries.

size

public int size()
Returns the size of this table.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.