T - the type of elements maintained by this Collectionpublic class Object2BooleanOpenHashMap<T> extends AbstractObject2BooleanMap<T> implements ITrimmable
AbstractObject2BooleanMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2BooleanMap.BuilderCache<T>, Object2BooleanMap.Entry<T>, Object2BooleanMap.FastEntrySet<T>, Object2BooleanMap.MapBuilder| Constructor and Description |
|---|
Object2BooleanOpenHashMap()
Default Constructor
|
Object2BooleanOpenHashMap(int minCapacity)
Constructor that defines the minimum capacity
|
Object2BooleanOpenHashMap(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
Object2BooleanOpenHashMap(java.util.Map<? extends T,? extends java.lang.Boolean> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2BooleanOpenHashMap(java.util.Map<? extends T,? extends java.lang.Boolean> map,
float loadFactor)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2BooleanOpenHashMap(Object2BooleanMap<T> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2BooleanOpenHashMap(Object2BooleanMap<T> map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2BooleanOpenHashMap(T[] keys,
boolean[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2BooleanOpenHashMap(T[] keys,
java.lang.Boolean[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Object2BooleanOpenHashMap(T[] keys,
boolean[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
Object2BooleanOpenHashMap(T[] keys,
java.lang.Boolean[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
boolean |
computeBoolean(T key,
ObjectBooleanUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
computeBooleanIfAbsent(T key,
Object2BooleanFunction<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
computeBooleanIfPresent(T key,
ObjectBooleanUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(boolean value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
Object2BooleanOpenHashMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(ObjectBooleanConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Boolean |
get(java.lang.Object key) |
boolean |
getBoolean(T key)
A Type Specific get method to reduce boxing/unboxing
|
boolean |
getOrDefault(T key,
boolean defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<T> |
keySet() |
void |
mergeAllBoolean(Object2BooleanMap<T> m,
BooleanBooleanUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
boolean |
mergeBoolean(T key,
boolean value,
BooleanBooleanUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
ObjectSet<Object2BooleanMap.Entry<T>> |
object2BooleanEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
boolean |
put(T key,
boolean value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
putIfAbsent(T key,
boolean value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remOrDefault(T key,
boolean defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
java.lang.Boolean |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
boolean |
remove(T key,
boolean value)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
replace(T key,
boolean value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
boolean oldValue,
boolean newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
boolean |
supplyBooleanIfAbsent(T key,
BooleanSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
BooleanCollection |
values() |
entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceBooleans, replaceBooleans, setDefaultReturnValueclearAndTrim, trimbuilder, compute, computeIfAbsent, computeIfPresent, forEach, merge, putAll, putAll, putIfAbsent, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic Object2BooleanOpenHashMap()
public Object2BooleanOpenHashMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Object2BooleanOpenHashMap(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2BooleanOpenHashMap(T[] keys, java.lang.Boolean[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Object2BooleanOpenHashMap(T[] keys, java.lang.Boolean[] values, float loadFactor)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2BooleanOpenHashMap(T[] keys, boolean[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Object2BooleanOpenHashMap(T[] keys, boolean[] values, float loadFactor)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2BooleanOpenHashMap(java.util.Map<? extends T,? extends java.lang.Boolean> map)
map - the values that should be present in the mappublic Object2BooleanOpenHashMap(java.util.Map<? extends T,? extends java.lang.Boolean> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2BooleanOpenHashMap(Object2BooleanMap<T> map)
map - the values that should be present in the mappublic Object2BooleanOpenHashMap(Object2BooleanMap<T> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public boolean put(T key, boolean value)
Object2BooleanMapput in interface Object2BooleanMap<T>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public boolean putIfAbsent(T key, boolean value)
Object2BooleanMapputIfAbsent in interface Object2BooleanMap<T>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,java.lang.Boolean>containsKey in class AbstractObject2BooleanMap<T>public boolean containsValue(boolean value)
Object2BooleanMapcontainsValue in interface Object2BooleanMap<T>containsValue in class AbstractObject2BooleanMap<T>value - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<T,java.lang.Boolean>containsValue in interface Object2BooleanMap<T>containsValue in class java.util.AbstractMap<T,java.lang.Boolean>value - that is searched for.Map.containsValue(Object)public boolean rem(T key)
Object2BooleanMaprem in interface Object2BooleanMap<T>key - the element that should be removedpublic boolean remOrDefault(T key, boolean defaultValue)
Object2BooleanMapremOrDefault in interface Object2BooleanMap<T>key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public java.lang.Boolean remove(java.lang.Object key)
remove in interface java.util.Map<T,java.lang.Boolean>remove in interface Object2BooleanMap<T>remove in class AbstractObject2BooleanMap<T>key - the element that should be removedMap.remove(Object)public boolean remove(T key, boolean value)
Object2BooleanMapremove in interface Object2BooleanMap<T>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<T,java.lang.Boolean>remove in interface Object2BooleanMap<T>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean getBoolean(T key)
Object2BooleanMapgetBoolean in interface Object2BooleanFunction<T>getBoolean in interface Object2BooleanMap<T>key - the key that is searched forpublic java.lang.Boolean get(java.lang.Object key)
get in interface java.util.Map<T,java.lang.Boolean>get in interface Object2BooleanMap<T>get in class AbstractObject2BooleanMap<T>public boolean getOrDefault(T key, boolean defaultValue)
Object2BooleanMapgetOrDefault in interface Object2BooleanMap<T>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Object2BooleanOpenHashMap<T> copy()
Object2BooleanMapcopy in interface Object2BooleanMap<T>copy in class AbstractObject2BooleanMap<T>public ObjectSet<Object2BooleanMap.Entry<T>> object2BooleanEntrySet()
Object2BooleanMapobject2BooleanEntrySet in interface Object2BooleanMap<T>public ObjectSet<T> keySet()
keySet in interface java.util.Map<T,java.lang.Boolean>keySet in interface Object2BooleanMap<T>keySet in class AbstractObject2BooleanMap<T>public BooleanCollection values()
values in interface java.util.Map<T,java.lang.Boolean>values in interface Object2BooleanMap<T>values in class AbstractObject2BooleanMap<T>public void forEach(ObjectBooleanConsumer<T> action)
Object2BooleanMapforEach in interface Object2BooleanMap<T>forEach in class AbstractObject2BooleanMap<T>action - processor of the values that are iterator overpublic boolean replace(T key, boolean oldValue, boolean newValue)
Object2BooleanMapreplace in interface Object2BooleanMap<T>replace in class AbstractObject2BooleanMap<T>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public boolean replace(T key, boolean value)
Object2BooleanMapreplace in interface Object2BooleanMap<T>replace in class AbstractObject2BooleanMap<T>key - the element that should be searched forvalue - the value to replace with.public boolean computeBoolean(T key, ObjectBooleanUnaryOperator<T> mappingFunction)
Object2BooleanMapcomputeBoolean in interface Object2BooleanMap<T>computeBoolean in class AbstractObject2BooleanMap<T>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic boolean computeBooleanIfAbsent(T key, Object2BooleanFunction<T> mappingFunction)
Object2BooleanMapcomputeBooleanIfAbsent in interface Object2BooleanMap<T>computeBooleanIfAbsent in class AbstractObject2BooleanMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic boolean supplyBooleanIfAbsent(T key, BooleanSupplier valueProvider)
Object2BooleanMapsupplyBooleanIfAbsent in interface Object2BooleanMap<T>supplyBooleanIfAbsent in class AbstractObject2BooleanMap<T>key - the key that should be computedvalueProvider - the value if not presentpublic boolean computeBooleanIfPresent(T key, ObjectBooleanUnaryOperator<T> mappingFunction)
Object2BooleanMapcomputeBooleanIfPresent in interface Object2BooleanMap<T>computeBooleanIfPresent in class AbstractObject2BooleanMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic boolean mergeBoolean(T key, boolean value, BooleanBooleanUnaryOperator mappingFunction)
Object2BooleanMapmergeBoolean in interface Object2BooleanMap<T>mergeBoolean in class AbstractObject2BooleanMap<T>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllBoolean(Object2BooleanMap<T> m, BooleanBooleanUnaryOperator mappingFunction)
Object2BooleanMapmergeAllBoolean in interface Object2BooleanMap<T>mergeAllBoolean in class AbstractObject2BooleanMap<T>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
public void clear()
public boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowed