/** * Gets an English word that describes a numbered position in some sequence, if this knows it (such as "second" or * "eleventh"), where the number is chosen randomly between lowest and highest, both inclusive. These words are * known from 1 ("first") to 20 ("twentieth"), as well as some output for other numbers (such as "42nd" or "23rd"). * @param lowest the lower bound for numbers this can choose, inclusive * @param highest the upper bound for numbers this can choose, inclusive * @return a String word for a number in the given range, such as "third" or "twelfth", if it is known */ public String numberAdjectiveInRange(int lowest, int highest) { return numberAdjective(rng.nextSignedInt(highest + 1 - lowest) + lowest); }
/** * Gets an English word for a number, if this knows it, where the number is chosen randomly between lowest and * highest, both inclusive. These words are known from 0 ("zero") to 20 ("twenty"), as well as some higher numbers. * If a word isn't known for a number, this returns the number as a String, such as "537" or "-1". * @param lowest the lower bound for numbers this can choose, inclusive * @param highest the upper bound for numbers this can choose, inclusive * @return a String word for a number in the given range, such as "six" or "eleven", if it is known */ public String numberWordInRange(int lowest, int highest) { return numberWord(rng.nextSignedInt(highest + 1 - lowest) + lowest); } /**