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