@Nullable public LinearInterpolator toLinearInterpolator() { if (values.isEmpty()) { return null; } if (!containsTimeValues()) { return null; } LinearInterpolator interpolator = new LinearInterpolator(); for (Attributes p : values) { interpolator.addPoint(p.getAsFloat("time"), p.getAsFloat("value")); } return interpolator; }