Class Double2FloatFunctions.Singleton

java.lang.Object
it.unimi.dsi.fastutil.doubles.AbstractDouble2FloatFunction
it.unimi.dsi.fastutil.doubles.Double2FloatFunctions.Singleton
All Implemented Interfaces:
it.unimi.dsi.fastutil.doubles.Double2FloatFunction, it.unimi.dsi.fastutil.Function<Double,Float>, Serializable, Cloneable, DoubleUnaryOperator, Function<Double,Float>
Direct Known Subclasses:
Double2FloatMaps.Singleton
Enclosing class:
Double2FloatFunctions

public static class Double2FloatFunctions.Singleton extends AbstractDouble2FloatFunction implements Serializable, Cloneable
An immutable class representing a type-specific singleton function. Note that the default return value is still settable.

Note that albeit the function is immutable, its default return value may be changed.

This class may be useful to implement your own in case you subclass a type-specific function.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final double
     
    protected final float
     

    Fields inherited from class it.unimi.dsi.fastutil.doubles.AbstractDouble2FloatFunction

    defRetValue
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Singleton(double key, float value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    containsKey(double k)
     
    float
    get(double k)
     
    float
    getOrDefault(double k, float defaultValue)
     
    int
     

    Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDouble2FloatFunction

    defaultReturnValue, defaultReturnValue

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface it.unimi.dsi.fastutil.doubles.Double2FloatFunction

    andThen, andThenByte, andThenChar, andThenDouble, andThenFloat, andThenInt, andThenLong, andThenObject, andThenReference, andThenShort, applyAsDouble, compose, composeByte, composeChar, composeDouble, composeFloat, composeInt, composeLong, composeObject, composeReference, composeShort, containsKey, get, getOrDefault, put, put, remove, remove

    Methods inherited from interface java.util.function.DoubleUnaryOperator

    andThen, compose

    Methods inherited from interface it.unimi.dsi.fastutil.Function

    apply, clear
  • Field Details

    • key

      protected final double key
    • value

      protected final float value
  • Constructor Details

    • Singleton

      protected Singleton(double key, float value)
  • Method Details

    • containsKey

      public boolean containsKey(double k)
      Specified by:
      containsKey in interface it.unimi.dsi.fastutil.doubles.Double2FloatFunction
    • get

      public float get(double k)
      Specified by:
      get in interface it.unimi.dsi.fastutil.doubles.Double2FloatFunction
    • getOrDefault

      public float getOrDefault(double k, float defaultValue)
      Specified by:
      getOrDefault in interface it.unimi.dsi.fastutil.doubles.Double2FloatFunction
    • size

      public int size()
      Specified by:
      size in interface it.unimi.dsi.fastutil.Function<Double,Float>
    • clone

      public Object clone()
      Overrides:
      clone in class Object