/** * Get the value for the given timestamp index. * <p> * Return <code>defaultValue</code> if the value is not found. * * @param timestamp timestamp index * @param defaultValue default value * @return found value or the default value if not found */ public double getDouble(double timestamp, double defaultValue) { final int index = getIndex(timestamp); if (index >= 0) { return values[index]; } return defaultValue; }
/** * Get the value for the given timestamp index. * <p> * Return <code>defaultValue</code> if the value is not found. * * @param timestamp timestamp index * @param defaultValue default value * @return found value or the default value if not found */ public double getDouble(double timestamp, double defaultValue) { final int index = getIndex(timestamp); if (index >= 0) { return values[index]; } return defaultValue; }
/** * Get the value for the given timestamp index. * * @param timestamp timestamp index * @return found value or the default value if not found * @throws IllegalArgumentException if the element doesn't exist */ public double getDouble(double timestamp) { final int index = getIndex(timestamp); if (index >= 0) { return values[index]; } throw new IllegalArgumentException("The element doesn't exist"); }
/** * Get the value for the given timestamp index. * * @param timestamp timestamp index * @return found value or the default value if not found * @throws IllegalArgumentException if the element doesn't exist */ public double getDouble(double timestamp) { final int index = getIndex(timestamp); if (index >= 0) { return values[index]; } throw new IllegalArgumentException("The element doesn't exist"); }