'Get some values in a MAP

I have a map in my code:

LinkedHashMap <double, double> fator = likedHashMap;

factor\[30\] = 1.0;
factor\[40\] = 1.2;
factor\[50\] = 1.4;
factor\[60\] = 1.6;

// I would like to create a function that when I insert an intermediate key for example: 35; I can interpolate the value, so for that I need to enter a value (key) and my function returns a value before and after it is in my MAP.

Exemple:

double newValue = 35;

newFunction returns 1.0 and 1.2.

values that refer to keys 30 and 40.

I need to get this values for to do my linear interpolation.

Thank you for your attention guys...

regards ;)

I just have mi list Map, and a need to get some values


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source