public interface IngredientList extends OsidList
Like all OsidLists, IngredientList
provides a means for accessing Ingredient elements
sequentially either one at a time or many at a time. Examples:
while (il.hasNext()) {
Ingredient ingredient = il.getNextIngredient();
}
or
while (il.hasNext()) {
Ingredient[] ingredients = il.getNextIngredients(il.available());
}
| Modifier and Type | Method and Description |
|---|---|
Ingredient |
getNextIngredient()
Gets the next
Ingredient in this list. |
Ingredient[] |
getNextIngredients(long n)
Gets the next set of
Ingredient elements in this list. |
Ingredient getNextIngredient() throws OperationFailedException
Ingredient in this list. Ingredient in this list. The
hasNext() method should be used to test that a next
Ingredient is available before calling this
method.IllegalStateException - no more elements available in
this listOperationFailedException - unable to complete requestmandatory - This method must be implemented. Ingredient[] getNextIngredients(long n) throws OperationFailedException
Ingredient elements in this list.
The specified amount must be less than or equal to the return from
available(). n - the number of Ingredient elements requested
which must be less than or equal to available() Ingredient elements.
The length of the array is less than or equal to the number
specified.IllegalStateException - no more elements available in
this listOperationFailedException - unable to complete requestmandatory - This method must be implemented.