Package org.tensorics.core.function
Class MapBackedDiscreteFunction<X,Y>
- java.lang.Object
-
- org.tensorics.core.function.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 ofDiscreteFunction
backed by aMap
- See Also:
DiscreteFunction
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapBackedDiscreteFunction.Builder<X,Y>
The builder for the function based on a map.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Y
apply(X input)
static <X,Y>
MapBackedDiscreteFunction.Builder<X,Y>builder()
java.util.Set<X>
definedXValues()
boolean
equals(java.lang.Object obj)
static <X,Y>
DiscreteFunction<X,Y>fromMap(java.util.Map<? extends X,? extends Y> function)
int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
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 interfaceDiscreteFunction<X,Y>
- Returns:
- values for which the function is defined
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
builder
public static final <X,Y> MapBackedDiscreteFunction.Builder<X,Y> builder()
-
-