Schnittstelle Object2BooleanMap<T>

Typparameter:
T - the keyType of elements maintained by this Collection
Alle Superschnittstellen:
Map<T,Boolean>, Predicate<T>
Alle bekannten Unterschnittstellen:
Object2BooleanConcurrentMap<T>, Object2BooleanNavigableMap<T>, Object2BooleanOrderedMap<T>, Object2BooleanSortedMap<T>
Alle bekannten Implementierungsklassen:
AbstractObject2BooleanMap, Enum2BooleanMap, ImmutableObject2BooleanOpenHashMap, LinkedEnum2BooleanMap, Object2BooleanArrayMap, Object2BooleanAVLTreeMap, Object2BooleanConcurrentOpenHashMap, Object2BooleanLinkedOpenCustomHashMap, Object2BooleanLinkedOpenHashMap, Object2BooleanMaps.EmptyMap, Object2BooleanMaps.SingletonMap, Object2BooleanMaps.SynchronizedMap, Object2BooleanMaps.SynchronizedNavigableMap, Object2BooleanMaps.SynchronizedOrderedMap, Object2BooleanMaps.SynchronizedSortedMap, Object2BooleanMaps.UnmodifyableMap, Object2BooleanMaps.UnmodifyableNavigableMap, Object2BooleanMaps.UnmodifyableOrderedMap, Object2BooleanMaps.UnmodifyableSortedMap, Object2BooleanOpenCustomHashMap, Object2BooleanOpenHashMap, Object2BooleanRBTreeMap

public interface Object2BooleanMap<T> extends Map<T,Boolean>, Predicate<T>
A Type Specific Map that reduces memory overhead due to boxing/unboxing of Primitives and some extra helper functions.
  • Methodendetails

    • builder

      static Object2BooleanMap.MapBuilder builder()
      Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.
      Gibt zurück:
      a MapBuilder
    • getDefaultReturnValue

      boolean getDefaultReturnValue()
      Method to see what the default return value is.
      Gibt zurück:
      default return value
    • setDefaultReturnValue

      Object2BooleanMap<T> setDefaultReturnValue(boolean v)
      Method to define the default return value if a requested key isn't present
      Parameter:
      v - value that should be the default return value
      Gibt zurück:
      itself
    • copy

      A Function that does a shallow clone of the Map itself. This function is more optimized then a copy constructor since the Map does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk
      Gibt zurück:
      a Shallow Copy of the Map
      Note:
      Wrappers and view Maps will not support this feature
    • put

      boolean put(T key, boolean value)
      Type Specific method to reduce boxing/unboxing of values
      Parameter:
      key - the key that should be inserted,
      value - the value that should be inserted
      Gibt zurück:
      the last present value or default return value.
      Siehe auch:
    • put

      default boolean put(Object2BooleanMap.Entry<T> entry)
      A Helper method that allows to put int a Object2BooleanMap.Entry into a map.
      Parameter:
      entry - then Entry that should be inserted.
      Gibt zurück:
      the last present value or default return value.
    • put

      default Boolean put(Map.Entry<T,Boolean> entry)
      A Helper method that allows to put int a Map.Entry into a map.
      Parameter:
      entry - then Entry that should be inserted.
      Gibt zurück:
      the last present value or default return value.
    • putAll

      default void putAll(T[] keys, boolean[] values)
      Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      Löst aus:
      IllegalStateException - if the arrays are not the same size
      Siehe auch:
    • putAll

      void putAll(T[] keys, boolean[] values, int offset, int size)
      Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      offset - where the to start in the array
      size - how many elements should be added
      Löst aus:
      IllegalStateException - if the arrays are not within the range
      Siehe auch:
    • putAll

      default void putAll(T[] keys, Boolean[] values)
      Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      Löst aus:
      IllegalStateException - if the arrays are not the same size
      Siehe auch:
    • putAll

      void putAll(T[] keys, Boolean[] values, int offset, int size)
      Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      offset - where the to start in the array
      size - how many elements should be added
      Löst aus:
      IllegalStateException - if the arrays are not within the range
      Siehe auch:
    • putIfAbsent

      boolean putIfAbsent(T key, boolean value)
      Type Specific method to reduce boxing/unboxing of values
      Parameter:
      key - the key that should be inserted,
      value - the value that should be inserted
      Gibt zurück:
      the last present value or default return value.
      Siehe auch:
    • putAllIfAbsent

      void putAllIfAbsent(Object2BooleanMap<T> m)
      Type-Specific bulk put method put elements into the map if not present.
      Parameter:
      m - elements that should be added if not present.
    • putAll

      void putAll(Object2BooleanMap<T> m)
      Type Specific function for the bull putting of values
      Parameter:
      m - the elements that should be inserted
    • containsValue

      boolean containsValue(boolean value)
      Type Specific method to reduce boxing/unboxing of values
      Parameter:
      value - element that is searched for
      Gibt zurück:
      if the value is present
    • containsValue

      default boolean containsValue(Object value)
      Angegeben von:
      containsValue in Schnittstelle Map<T,Boolean>
      Parameter:
      value - that is searched for.
      Gibt zurück:
      true if found
      Siehe auch:
      Note:
      in some implementations key does not have to be CLASS_VALUE but just have to support equals with CLASS_VALUE.
    • rem

      boolean rem(T key)
      Type Specific remove function to reduce boxing/unboxing
      Parameter:
      key - the element that should be removed
      Gibt zurück:
      the value that was removed or default return value
    • remove

      default Boolean remove(Object key)
      Angegeben von:
      remove in Schnittstelle Map<T,Boolean>
      Parameter:
      key - the element that should be removed
      Gibt zurück:
      the value that was removed or default return value
      Siehe auch:
      Note:
      in some implementations key does not have to be T but just have to support equals with T.
    • remove

      boolean remove(T key, boolean value)
      Type Specific remove function to reduce boxing/unboxing
      Parameter:
      key - the element that should be removed
      value - the expected value that should be found
      Gibt zurück:
      true if the key and value was found and removed
      Siehe auch:
    • remove

      default boolean remove(Object key, Object value)
      Angegeben von:
      remove in Schnittstelle Map<T,Boolean>
      Parameter:
      key - the element that should be removed
      value - the expected value that should be found
      Gibt zurück:
      true if the key and value was found and removed
      Siehe auch:
    • remOrDefault

      boolean remOrDefault(T key, boolean defaultValue)
      Type-Specific Remove function with a default return value if wanted.
      Parameter:
      key - the element that should be removed
      defaultValue - the value that should be returned if the entry doesn't exist
      Gibt zurück:
      the value that was removed or default value
      Siehe auch:
    • replace

      boolean replace(T key, boolean oldValue, boolean newValue)
      A Type Specific replace method to replace an existing value
      Parameter:
      key - the element that should be searched for
      oldValue - the expected value to be replaced
      newValue - the value to replace the oldValue with.
      Gibt zurück:
      true if the value got replaced
      Note:
      this fails if the value is not present even if it matches the oldValue
    • replace

      boolean replace(T key, boolean value)
      A Type Specific replace method to reduce boxing/unboxing replace an existing value
      Parameter:
      key - the element that should be searched for
      value - the value to replace with.
      Gibt zurück:
      the present value or default return value
      Note:
      this fails if the value is not present
    • replaceBooleans

      void replaceBooleans(Object2BooleanMap<T> m)
      Type-Specific bulk replace method. Could be seen as putAllIfPresent
      Parameter:
      m - elements that should be replaced.
    • replaceBooleans

      void replaceBooleans(ObjectBooleanUnaryOperator<T> mappingFunction)
      A Type Specific mass replace method to reduce boxing/unboxing
      Parameter:
      mappingFunction - operation to replace all values
    • computeBoolean

      boolean computeBoolean(T key, ObjectBooleanUnaryOperator<T> mappingFunction)
      A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value
      Gibt zurück:
      the result of the computation
    • computeBooleanIfAbsent

      boolean computeBooleanIfAbsent(T key, Predicate<T> mappingFunction)
      A Type Specific computeIfAbsent method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value if not present
      Gibt zurück:
      the result of the computed value or present value
    • supplyBooleanIfAbsent

      boolean supplyBooleanIfAbsent(T key, BooleanSupplier valueProvider)
      A Supplier based computeIfAbsent function to fill the most used usecase of this function If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      valueProvider - the value if not present
      Gibt zurück:
      the result of the computed value or present value
    • computeBooleanIfPresent

      boolean computeBooleanIfPresent(T key, ObjectBooleanUnaryOperator<T> mappingFunction)
      A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value if present
      Gibt zurück:
      the result of the default return value or present value
      Note:
      if not present then compute is not executed
    • computeBooleanNonDefault

      boolean computeBooleanNonDefault(T key, ObjectBooleanUnaryOperator<T> mappingFunction)
      A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value
      Gibt zurück:
      the result of the computation
    • computeBooleanIfAbsentNonDefault

      boolean computeBooleanIfAbsentNonDefault(T key, Predicate<T> mappingFunction)
      A Type Specific computeIfAbsent method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value if not present
      Gibt zurück:
      the result of the computed value or present value
    • supplyBooleanIfAbsentNonDefault

      boolean supplyBooleanIfAbsentNonDefault(T key, BooleanSupplier valueProvider)
      A Supplier based computeIfAbsent function to fill the most used usecase of this function If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      valueProvider - the value if not present
      Gibt zurück:
      the result of the computed value or present value
    • computeBooleanIfPresentNonDefault

      boolean computeBooleanIfPresentNonDefault(T key, ObjectBooleanUnaryOperator<T> mappingFunction)
      A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value if present
      Gibt zurück:
      the result of the default return value or present value
      Note:
      if not present then compute is not executed
    • mergeBoolean

      boolean mergeBoolean(T key, boolean value, BooleanBooleanUnaryOperator mappingFunction)
      A Type Specific merge method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be be searched for
      value - the value that should be merged with
      mappingFunction - the operator that should generate the new Value
      Gibt zurück:
      the result of the merge
      Note:
      if the result matches the default return value then the key is removed from the map
    • mergeAllBoolean

      void mergeAllBoolean(Object2BooleanMap<T> m, BooleanBooleanUnaryOperator mappingFunction)
      A Bulk method for merging Maps. If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      m - the entries that should be bulk added
      mappingFunction - the operator that should generate the new Value
      Note:
      if the result matches the default return value then the key is removed from the map
    • replace

      default boolean replace(T key, Boolean oldValue, Boolean newValue)
      Angegeben von:
      replace in Schnittstelle Map<T,Boolean>
    • replace

      default Boolean replace(T key, Boolean value)
      Angegeben von:
      replace in Schnittstelle Map<T,Boolean>
    • test

      default boolean test(T key)
      Angegeben von:
      test in Schnittstelle Predicate<T>
    • getBoolean

      boolean getBoolean(T key)
      A Type Specific get method to reduce boxing/unboxing
      Parameter:
      key - the key that is searched for
      Gibt zurück:
      the searched value or default return value
    • getOrDefault

      boolean getOrDefault(T key, boolean defaultValue)
      A Type Specific getOrDefault method to reduce boxing/unboxing
      Parameter:
      key - the key that is searched for
      defaultValue - the value that should be returned if the key is not present
      Gibt zurück:
      the searched value or defaultValue value
    • get

      default Boolean get(Object key)
      Angegeben von:
      get in Schnittstelle Map<T,Boolean>
    • getOrDefault

      default Boolean getOrDefault(Object key, Boolean defaultValue)
      Angegeben von:
      getOrDefault in Schnittstelle Map<T,Boolean>
    • replaceAll

      default void replaceAll(BiFunction<? super T,? super Boolean,? extends Boolean> mappingFunction)
      Angegeben von:
      replaceAll in Schnittstelle Map<T,Boolean>
    • compute

      default Boolean compute(T key, BiFunction<? super T,? super Boolean,? extends Boolean> mappingFunction)
      Angegeben von:
      compute in Schnittstelle Map<T,Boolean>
    • computeIfAbsent

      default Boolean computeIfAbsent(T key, Function<? super T,? extends Boolean> mappingFunction)
      Angegeben von:
      computeIfAbsent in Schnittstelle Map<T,Boolean>
    • computeIfPresent

      default Boolean computeIfPresent(T key, BiFunction<? super T,? super Boolean,? extends Boolean> mappingFunction)
      Angegeben von:
      computeIfPresent in Schnittstelle Map<T,Boolean>
    • merge

      default Boolean merge(T key, Boolean value, BiFunction<? super Boolean,? super Boolean,? extends Boolean> mappingFunction)
      Angegeben von:
      merge in Schnittstelle Map<T,Boolean>
    • forEach

      void forEach(ObjectBooleanConsumer<T> action)
      Type Specific forEach method to reduce boxing/unboxing
      Parameter:
      action - processor of the values that are iterator over
    • forEach

      default void forEach(BiConsumer<? super T,? super Boolean> action)
      Angegeben von:
      forEach in Schnittstelle Map<T,Boolean>
    • keySet

      ObjectSet<T> keySet()
      Angegeben von:
      keySet in Schnittstelle Map<T,Boolean>
    • values

      Angegeben von:
      values in Schnittstelle Map<T,Boolean>
    • entrySet

      Angegeben von:
      entrySet in Schnittstelle Map<T,Boolean>
    • object2BooleanEntrySet

      ObjectSet<Object2BooleanMap.Entry<T>> object2BooleanEntrySet()
      Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
      Gibt zurück:
      a EntrySet of the collection
    • synchronize

      default Object2BooleanMap<T> synchronize()
      Creates a Wrapped Map that is Synchronized
      Gibt zurück:
      a new Map that is synchronized
      Siehe auch:
    • synchronize

      default Object2BooleanMap<T> synchronize(Object mutex)
      Creates a Wrapped Map that is Synchronized
      Parameter:
      mutex - is the controller of the synchronization block
      Gibt zurück:
      a new Map Wrapper that is synchronized
      Siehe auch:
    • unmodifiable

      default Object2BooleanMap<T> unmodifiable()
      Creates a Wrapped Map that is unmodifiable
      Gibt zurück:
      a new Map Wrapper that is unmodifiable
      Siehe auch:
    • put

      default Boolean put(T key, Boolean value)
      Angegeben von:
      put in Schnittstelle Map<T,Boolean>
    • putIfAbsent

      default Boolean putIfAbsent(T key, Boolean value)
      Angegeben von:
      putIfAbsent in Schnittstelle Map<T,Boolean>