public final class CollectionsFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
CollectionsFactory.ICollectionsFramework
Interface abstracting over a collections technology that provides custom collection implementations.
|
static class |
CollectionsFactory.MemoryType
The type of
IMemory |
Constructor and Description |
---|
CollectionsFactory() |
Modifier and Type | Method and Description |
---|---|
static <T> IDeltaBag<T> |
createDeltaBag()
Instantiates a new empty delta bag.
|
static <K,V> java.util.Map<K,V> |
createMap()
Instantiates a new empty map.
|
static <K,V> java.util.Map<K,V> |
createMap(java.util.Map<K,V> initial)
Instantiates a new map with the given initial contents.
|
static <T> IMemory<T> |
createMemory(java.lang.Class<? super T> values,
CollectionsFactory.MemoryType memoryType)
Instantiates a memory storing values.
|
static <K,V> IMultiLookup<K,V> |
createMultiLookup(java.lang.Class<? super K> fromKeys,
CollectionsFactory.MemoryType toBuckets,
java.lang.Class<? super V> ofValues)
Instantiates a size-optimized multimap from keys to sets of values.
|
static <T> IMultiset<T> |
createMultiset()
Instantiates a new empty multiset.
|
static <O> java.util.List<O> |
createObserverList()
Instantiates a new list that is optimized for registering observers / callbacks.
|
static <E> java.util.Set<E> |
createSet()
Instantiates a new empty set.
|
static <E> java.util.Set<E> |
createSet(java.util.Collection<E> initial)
Instantiates a new set with the given initial contents.
|
static <K,V> java.util.TreeMap<K,V> |
createTreeMap()
Instantiates a new tree map.
|
static <T> IMultiset<T> |
emptyMultiset(java.lang.Object key)
Instantiates an empty multiset; the key parameter is used to allow using this as a method reference as a
Function , e.g. |
static <T> java.util.Set<T> |
emptySet(java.lang.Object key)
Instantiates an empty set; the key parameter is used to allow using this as a method reference as a
Function , e.g. |
public static <K,V> java.util.Map<K,V> createMap()
public static <K,V> java.util.Map<K,V> createMap(java.util.Map<K,V> initial)
public static <K,V> java.util.TreeMap<K,V> createTreeMap()
public static <E> java.util.Set<E> createSet()
public static <E> java.util.Set<E> createSet(java.util.Collection<E> initial)
public static <T> java.util.Set<T> emptySet(java.lang.Object key)
Function
, e.g. in Map.computeIfAbsent(Object, Function)
.key
- the value of this parameter is ignoredpublic static <T> IMultiset<T> createMultiset()
public static <T> IMultiset<T> emptyMultiset(java.lang.Object key)
Function
, e.g. in Map.computeIfAbsent(Object, Function)
.key
- the value of this parameter is ignoredpublic static <T> IDeltaBag<T> createDeltaBag()
public static <O> java.util.List<O> createObserverList()
public static <K,V> IMultiLookup<K,V> createMultiLookup(java.lang.Class<? super K> fromKeys, CollectionsFactory.MemoryType toBuckets, java.lang.Class<? super V> ofValues)
For a single key, many values can be associated according to the given bucket semantics.
The keys and values are stored as type fromKeys resp. ofValues; currently Object.class and Long.class are supported.
public static <T> IMemory<T> createMemory(java.lang.Class<? super T> values, CollectionsFactory.MemoryType memoryType)
For a single key, many values can be associated according to the given memory semantics.
The values are stored as type 'values'; currently Object.class and Long.class are supported.