22 package com.realtime.crossfire.jxclient.skin.skin;
24 import java.util.Collections;
25 import java.util.Iterator;
26 import java.util.LinkedHashMap;
28 import org.jetbrains.annotations.NotNull;
29 import org.jetbrains.annotations.Nullable;
49 private final Map<String, T>
cache =
new LinkedHashMap<>();
74 if (cache.containsKey(name)) {
89 final T t = cache.get(name);
104 return cache.get(name);
114 return Collections.unmodifiableCollection(cache.values()).
iterator();
Iterator< T > iterator()
Returns all stored values.
final String ident
The description of this cache used for creating error messages.
JXCSkinCache(@NotNull final String ident)
Creates a new instance.
void insert(@NotNull final String name, @NotNull final T t)
Adds a new element to the cache.
void clear()
Forgets all cached elements.
T lookupOptional(@NotNull final String name)
Looks up an element by name.
Implements a cache for elements identified by name.
Exception thrown if a skin related problem occurs.
final Map< String, T > cache
The cached elements.
T lookup(@NotNull final String name)
Looks up an element by name.