T
- the type of the cached elementspublic class JXCSkinCache<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Constructor and Description |
---|
JXCSkinCache(@NotNull java.lang.String ident)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Forgets all cached elements.
|
@NotNull java.util.Collection<java.lang.String> |
getNames()
Returns all defined names.
|
void |
insert(@NotNull java.lang.String name,
T t)
Adds a new element to the cache.
|
@NotNull java.util.Iterator<T> |
iterator()
Returns all stored values.
|
T |
lookup(@NotNull java.lang.String name)
Looks up an element by name.
|
T |
lookupOptional(@NotNull java.lang.String name)
Looks up an element by name.
|
public JXCSkinCache(@NotNull @NotNull java.lang.String ident)
ident
- the description of this cache used for creating error
messagespublic void clear()
public void insert(@NotNull @NotNull java.lang.String name, @NotNull T t) throws JXCSkinException
name
- the element name to addt
- the element to addJXCSkinException
- if the element name is not unique@NotNull public T lookup(@NotNull @NotNull java.lang.String name) throws JXCSkinException
name
- the name of the elementJXCSkinException
- if no such element exists@NotNull public @NotNull java.util.Collection<java.lang.String> getNames()
@Nullable public T lookupOptional(@NotNull @NotNull java.lang.String name)
name
- the name of the elementnull
if no such element exists