Interface Long2ObjectSyncMap.ExpungingEntry<V>

  • Type Parameters:
    V - the backing value type
    Enclosing interface:
    Long2ObjectSyncMap<V>

    public static interface Long2ObjectSyncMap.ExpungingEntry<V>
    The expunging value the backing map wraps for its values.
    Since:
    2.0.0
    • Method Detail

      • exists

        boolean exists()
        Returns true if this entry has a value, that is neither null or expunged. Otherwise, it returns false.
        Returns:
        true if a value exists, otherwise false
        Since:
        2.0.0
      • get

        @Nullable V get()
        Returns the value or null if it has been expunged.
        Returns:
        the value or null if it is expunged
        Since:
        2.0.0
      • getOr

        @NonNull V getOr​(@NonNull V other)
        Returns the value if it exists, otherwise it returns the default value.
        Parameters:
        other - the default value
        Returns:
        the value if present, otherwise the default value
        Since:
        2.0.0
      • computeIfAbsentPrimitive

        @NonNull Long2ObjectSyncMap.InsertionResult<V> computeIfAbsentPrimitive​(long key,
                                                                                @NonNull it.unimi.dsi.fastutil.longs.Long2ObjectFunction<? extends V> function)
        Computes the specified value if a value doesn't already exist, returning an Long2ObjectSyncMap.InsertionResult.
        Parameters:
        key - the key
        function - the function
        Returns:
        the result entry
        Since:
        2.0.0
      • set

        void set​(@NonNull V value)
        Sets the value.
        Parameters:
        value - the value
        Since:
        2.0.0
      • replace

        boolean replace​(@NonNull Object compare,
                        @Nullable V value)
        Replaces the current value if it matches compare with the new value and returns true. Otherwise, it returns false.
        Parameters:
        compare - The comparing value
        value - The new value
        Returns:
        true if the value was replaced, otherwise false
        Since:
        2.0.0
      • clear

        @Nullable V clear()
        Clears the value.
        Returns:
        the value
        Since:
        2.0.0
      • trySet

        boolean trySet​(@NonNull V value)
        Attempts to set the value, if the value is not expunged and returns true. Otherwise, it returns false.
        Returns:
        true if the value was set, otherwise false
        Since:
        2.0.0
      • tryReplace

        @Nullable V tryReplace​(@NonNull V value)
        Attempts to replace the value, if the value is not expunged or null and returns the previous value. Otherwise, it returns null.
        Parameters:
        value - the value
        Returns:
        the previous value if it exists, otherwise null
        Since:
        2.0.0
      • tryExpunge

        boolean tryExpunge()
        Attempts to expunge the value, if the value is null and returns true. Otherwise, it returns false.
        Returns:
        true if the value was expunged, otherwise false
        Since:
        2.0.0
      • tryUnexpungeAndSet

        boolean tryUnexpungeAndSet​(@NonNull V value)
        Attempts to unexpunge the value and set it, if the value was expunged and returns true. Otherwise, it returns false.
        Parameters:
        value - the value
        Returns:
        true if the value was unexpunged, otherwise false
        Since:
        2.0.0
      • tryUnexpungeAndCompute

        boolean tryUnexpungeAndCompute​(long key,
                                       @NonNull LongFunction<? extends V> function)
        Attempts to unexpunge the value and compute it, if the value was expunged and returns true. Otherwise, it returns false.
        Parameters:
        key - the key
        function - the function
        Returns:
        true if the value was unexpunged, otherwise false
        Since:
        2.0.0
      • tryUnexpungeAndComputePrimitive

        boolean tryUnexpungeAndComputePrimitive​(long key,
                                                @NonNull it.unimi.dsi.fastutil.longs.Long2ObjectFunction<? extends V> function)
        Attempts to unexpunge the value and compute it, if the value was expunged and returns true. Otherwise, it returns false.
        Parameters:
        key - the key
        function - the function
        Returns:
        true if the value was unexpunged, otherwise false
        Since:
        2.0.0
      • tryUnexpungeAndCompute

        boolean tryUnexpungeAndCompute​(long key,
                                       @NonNull BiFunction<? super Long,​? super V,​? extends V> remappingFunction)
        Attempts to unexpunge the value and compute it, if the value was expunged and returns true. Otherwise, it returns false.
        Parameters:
        key - the key
        remappingFunction - the remapping function
        Returns:
        true if the value was unexpunged, otherwise false
        Since:
        2.0.0