Class MapBackedDiscreteFunction<X,​Y>

  • Type Parameters:
    X - the type of the values in x-direction (Independent variable)
    Y - the type of the values in y-direction (Dependent variable)
    All Implemented Interfaces:
    java.io.Serializable, java.util.function.Function<X,​Y>, DiscreteFunction<X,​Y>, MathFunction<X,​Y>

    public class MapBackedDiscreteFunction<X,​Y>
    extends java.lang.Object
    implements DiscreteFunction<X,​Y>, java.io.Serializable
    Implementation of DiscreteFunction backed by a Map
    See Also:
    DiscreteFunction, Serialized Form
    • Method Detail

      • apply

        public Y apply​(X input)
        Specified by:
        apply in interface DiscreteFunction<X,​Y>
        Specified by:
        apply in interface java.util.function.Function<X,​Y>
      • fromMap

        public static final <X,​Y> DiscreteFunction<X,​Y> fromMap​(java.util.Map<? extends X,​? extends Y> function)
      • definedXValues

        public java.util.Set<X> definedXValues()
        Specified by:
        definedXValues in interface DiscreteFunction<X,​Y>
        Returns:
        values for which the function is defined
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object