Class LoggingMap<KEY,VALUE>
java.lang.Object
com.ardor3d.extension.animation.skeletal.util.LoggingMap<KEY,VALUE>
- Direct Known Subclasses:
ImportClipMap
,OutputClipSourceMap
This class essentially just wraps a KEY/VALUE HashMap, providing extra logging when a VALUE is not found, or
duplicate VALUE objects are added. An optional callback may be provided to try to load values not present in this
map. These are loaded using the string representation of the key and casting the return from Object to the value
class. If the value is still null, a default value is returned.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a value from our store by key.boolean
boolean
keySet()
void
Add a value to the store.Removes the mapping for the given key.void
setDefaultValue
(VALUE defaultValue) void
setLogOnMissing
(boolean logOnMissing) void
setLogOnReplace
(boolean logOnReplace) void
setMissCallback
(MissingCallback<KEY, VALUE> missCallback) int
size()
values()
-
Field Details
-
_wrappedMap
Our map of values.
-
-
Constructor Details
-
LoggingMap
public LoggingMap()
-
-
Method Details
-
put
Add a value to the store. Logs a warning if a value by the same key was already in the store and logOnReplace is true.- Parameters:
key
- the key to add.value
- the value to add.
-
get
Retrieves a value from our store by key. Logs a warning if a value by that key is not found and logOnMissing is true. If missing, defaultValue is returned.- Parameters:
key
- the key of the value to find.- Returns:
- the associated value, or null if none is found.
-
remove
Removes the mapping for the given key.- Parameters:
key
- the key of the value to remove.- Returns:
- the previously associated value, or null if none was found.
-
size
public int size()- Returns:
- the number of key-value pairs stored in this object.
-
setDefaultValue
-
getDefaultValue
-
setLogOnReplace
public void setLogOnReplace(boolean logOnReplace) -
isLogOnReplace
public boolean isLogOnReplace() -
setLogOnMissing
public void setLogOnMissing(boolean logOnMissing) -
isLogOnMissing
public boolean isLogOnMissing() -
getMissCallback
-
setMissCallback
-
keySet
-
values
-