public interface CostList extends OsidList
Like all OsidLists, CostList provides a
means for accessing Cost elements sequentially either one
at a time or many at a time. Examples:
while (cl.hasNext()) {
Cost cost = cl.getNextCost();
}
or
while (cl.hasNext()) {
Cost[] costs = cl.getNextCosts(cl.available());
}
| Modifier and Type | Method and Description |
|---|---|
Cost |
getNextCost()
Gets the next
Cost in this list. |
Cost[] |
getNextCosts(long n)
Gets the next set of
Cost elements in this list. |
Cost getNextCost() throws OperationFailedException
Cost in this list. Cost in this list. The
hasNext() method should be used to test that a next
Cost is available before calling this method.IllegalStateException - no more elements available in
this listOperationFailedException - unable to complete requestmandatory - This method must be implemented. Cost[] getNextCosts(long n) throws OperationFailedException
Cost elements in this list. The
specified amount must be less than or equal to the return from
available(). n - the number of Cost elements requested which
must be less than or equal to available() Cost 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.