java.lang.Object com.realtime.crossfire.jxclient.skin.skin.JXCSkinCache<T>
public class JXCSkinCache<T>
Implements a cache for elements identified by name.
Field Summary | |
---|---|
private java.util.Map<java.lang.String,T> |
cache
The cached elements. |
private java.lang.String |
ident
The description of this cache used for creating error messages. |
Constructor Summary | |
---|---|
JXCSkinCache(java.lang.String ident)
Create a new instance. |
Method Summary | |
---|---|
void |
clear()
Forget all cached elements. |
void |
insert(java.lang.String name,
T t)
Add a new element to the cache. |
java.util.Iterator<T> |
iterator()
Return all stored values. |
T |
lookup(java.lang.String name)
Lookup an element by name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final java.util.Map<java.lang.String,T> cache
null
.
@NotNull private final java.lang.String ident
Constructor Detail |
---|
public JXCSkinCache(@NotNull java.lang.String ident)
ident
- The description of this cache used for creating error
messages.Method Detail |
---|
public void clear()
public void insert(@NotNull java.lang.String name, @NotNull T t) throws JXCSkinException
name
- The element name to add.t
- The element to add.
JXCSkinException
- if the element name is not unique@NotNull public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
@NotNull public T lookup(@NotNull java.lang.String name) throws JXCSkinException
name
- The name of the element.
JXCSkinException
- if no such element exists