T - The object typepublic class Dictionary<T>
extends java.lang.Object
| Constructor and Description |
|---|
Dictionary() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String key,
T... objects)
Add multiple objects to the dictionary.
|
void |
add(java.lang.String key,
T object)
Add an object to the dictionary.
|
java.util.Set<java.lang.String> |
find(T object)
Find the names of a given object.
|
void |
forEach(java.util.function.BiConsumer<? super java.lang.String,? super java.util.Set<T>> action) |
java.util.Set<T> |
get(java.lang.String name)
Get an object set from the dictionary.
|
java.util.Set<java.lang.String> |
keys()
Gets a
Set view of the names in this dictionary. |
java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.util.Set<T>>> |
parallelStream() |
void |
remove(java.lang.String key,
T... objects)
Removes multiple objects from the dictionary.
|
void |
remove(java.lang.String key,
T object)
Removes an object from the dictionary.
|
void |
removeAll(java.lang.String key)
Removes all objects from the dictionary registered for the key.
|
java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.util.Set<T>>> |
stream() |
EventListenerHandle<DictionaryEvent.Add<T>> |
whenEntryAdded(EventListener<DictionaryEvent.Add<T>> listener) |
EventListenerHandle<DictionaryEvent.Remove<T>> |
whenEntryRemoved(EventListener<DictionaryEvent.Remove<T>> listener) |
public void add(java.lang.String key,
T object)
key - the name of the object.object - the object to register.public void add(java.lang.String key,
T... objects)
key - the name of the object.objects - the objects to register.public void remove(java.lang.String key,
T object)
key - the name of the object.object - the object to remove.public void remove(java.lang.String key,
T... objects)
key - the name of the object.objects - the objects to remove.public void removeAll(java.lang.String key)
key - the name of the objectspublic java.util.Set<T> get(java.lang.String name)
name - the dictionary name.public java.util.Set<java.lang.String> find(T object)
object - the object to find.public java.util.Set<java.lang.String> keys()
Set view of the names in this dictionary.
This view is backed by the dictionary, but it cannot be used to modify the dictionary.
To do that use either remove(String, T)
or removeAll(String).Set view of the names in this dictionary.public void forEach(java.util.function.BiConsumer<? super java.lang.String,? super java.util.Set<T>> action)
public java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.util.Set<T>>> stream()
public java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.util.Set<T>>> parallelStream()
public EventListenerHandle<DictionaryEvent.Add<T>> whenEntryAdded(EventListener<DictionaryEvent.Add<T>> listener)
public EventListenerHandle<DictionaryEvent.Remove<T>> whenEntryRemoved(EventListener<DictionaryEvent.Remove<T>> listener)