org.jrabbit.base.graphics.font
Class FontPointer

java.lang.Object
  extended by org.jrabbit.base.data.cache.CachePointer<Font>
      extended by org.jrabbit.base.graphics.font.FontPointer
All Implemented Interfaces:
Referenced, Retriever<Font>

public class FontPointer
extends CachePointer<Font>

Provides a quick way to access Fonts in the default FontCache. A FontPointer is different from the default CachePointer because it allows the reference it uses to retrieve objects to be null. Doing so will cause the FontPointer to retrieve the Cache's default font. There is one caveat to using the default Font - if the default Font is changed (or even destroyed), then the FontPointer's refresh() must be called manually, or else the reference will not update.

Author:
Chris Molini

Field Summary
 
Fields inherited from class org.jrabbit.base.data.cache.CachePointer
object, reference
 
Constructor Summary
FontPointer()
          Creates a FontPointer that will access the default font in the FontCache.
FontPointer(java.lang.String reference)
          Creates a FontPointer that attempts to access a specific Font.
 
Method Summary
 Font object()
          Returns the object the CachePointer has retrieved.
 Font retrieve()
          Obtains the desired Font, based upon reference.
 
Methods inherited from class org.jrabbit.base.data.cache.CachePointer
reference, refresh, setReference, valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontPointer

public FontPointer()
Creates a FontPointer that will access the default font in the FontCache.


FontPointer

public FontPointer(java.lang.String reference)
Creates a FontPointer that attempts to access a specific Font.

Parameters:
reference - A reference that matches that of the Font to retrieve from the Cache.
Method Detail

retrieve

public Font retrieve()
Obtains the desired Font, based upon reference.

Returns:
A reference to the object.

object

public Font object()
Description copied from class: CachePointer
Returns the object the CachePointer has retrieved. NOTE: Theoretically, this can return a reference to an object that has been destroyed in the cache, since using this method doesn't actually check.

Overrides:
object in class CachePointer<Font>
Returns:
The stored object the CachePointer retrieves.