Crossfire JXClient, Trunk
Public Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T > Class Template Reference
Inheritance diagram for com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T >:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T >:
Collaboration graph

Public Member Functions

void clear ()
 
Collection< String > getNames ()
 
void insert (@NotNull final String name, @NotNull final T t) throws JXCSkinException
 
Iterator< T > iterator ()
 
 JXCSkinCache (@NotNull final String ident)
 
lookup (@NotNull final String name) throws JXCSkinException
 
lookupOptional (@NotNull final String name)
 

Private Attributes

final Map< String, T > cache = new LinkedHashMap<>()
 
final String ident
 

Detailed Description

Implements a cache for elements identified by name.

Parameters
<T>the type of the cached elements
Author
Andreas Kirschbaum

Definition at line 40 of file JXCSkinCache.java.

Constructor & Destructor Documentation

◆ JXCSkinCache()

Creates a new instance.

Parameters
identthe description of this cache used for creating error messages

Definition at line 60 of file JXCSkinCache.java.

Member Function Documentation

◆ clear()

Forgets all cached elements.

Definition at line 67 of file JXCSkinCache.java.

Referenced by com.realtime.crossfire.jxclient.skin.io.ImageParser.clear(), and com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.load().

Here is the caller graph for this function:

◆ getNames()

Collection<String> com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T >.getNames ( )

Returns all defined names.

Returns
the names in alphabetical order

Definition at line 106 of file JXCSkinCache.java.

◆ insert()

void com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T >.insert ( @NotNull final String  name,
@NotNull final T  t 
) throws JXCSkinException

Adds a new element to the cache.

Parameters
namethe element name to add
tthe element to add
Exceptions
JXCSkinExceptionif the element name is not unique

Definition at line 77 of file JXCSkinCache.java.

Referenced by com.realtime.crossfire.jxclient.skin.io.ImageParser.getImage(), and com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseFont().

Here is the caller graph for this function:

◆ iterator()

Returns all stored values.

Returns
an (read-only) iterator returning all stored values

Definition at line 128 of file JXCSkinCache.java.

◆ lookup()

T com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T >.lookup ( @NotNull final String  name) throws JXCSkinException

Looks up an element by name.

Parameters
namethe name of the element
Returns
the element
Exceptions
JXCSkinExceptionif no such element exists

Definition at line 92 of file JXCSkinCache.java.

Referenced by com.realtime.crossfire.jxclient.skin.io.ImageParser.getImage(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseButton(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseCharacterList(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseCommandText(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseDef(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseDupGauge(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseItem(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelFailure(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelHtml(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelMessage(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelMulti(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelNewchar(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelQuery(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelSoundsCredits(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelStat(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelStat2(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelText(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLogLabel(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLogMessage(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseMetaList(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseQueryText(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseText(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseTextGauge(), and com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseTooltip().

Here is the caller graph for this function:

◆ lookupOptional()

T com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T >.lookupOptional ( @NotNull final String  name)

Looks up an element by name.

Parameters
namethe name of the element
Returns
the element or
null
if no such element exists

Definition at line 118 of file JXCSkinCache.java.

Member Data Documentation

◆ cache

final Map<String, T> com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache< T >.cache = new LinkedHashMap<>()
private

◆ ident


The documentation for this class was generated from the following file: