Package org.apache.batik.gvt.font
Class AWTGlyphGeometryCache
- java.lang.Object
-
- org.apache.batik.gvt.font.AWTGlyphGeometryCache
-
public class AWTGlyphGeometryCache extends java.lang.ObjectThis class represents a doubly indexed hash table, which holds soft references to the contained glyph geometry informations.- Version:
- $Id: AWTGlyphGeometryCache.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAWTGlyphGeometryCache.EntryTo manage collisionsstatic classAWTGlyphGeometryCache.ValueThe object that holds glyph geometry.
-
Field Summary
Fields Modifier and Type Field Description protected intcountThe number of entriesprotected static intINITIAL_CAPACITYThe initial capacityprotected java.lang.ref.ReferenceQueuereferenceQueueThe reference queue.protected AWTGlyphGeometryCache.Entry[]tableThe underlying array
-
Constructor Summary
Constructors Constructor Description AWTGlyphGeometryCache()Creates a new AWTGlyphGeometryCache.AWTGlyphGeometryCache(int c)Creates a new AWTGlyphGeometryCache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the table.AWTGlyphGeometryCache.Valueget(char c)Gets the value of a variableprotected 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 variableprotected voidrehash()Rehash the tableprotected voidremoveClearedEntries()Removes the cleared entries.intsize()Returns the size of this table.
-
-
-
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 java.lang.ref.ReferenceQueue referenceQueue
The reference queue.
-
-
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.
-
-