Beispiel #1
0
 /**
  * Applies the procedure to each value in the list in descending (back to front) order.
  *
  * @param procedure a <code>LongProcedure</code> value
  * @return true if the procedure did not terminate prematurely.
  */
 public boolean forEachDescending(LongProcedure procedure) {
   for (int i = pos; i-- > 0; ) if (!procedure.execute(data[i])) return false;
   return true;
 }
Beispiel #2
0
 /**
  * Applies the procedure to each value in the list in ascending (front to back) order.
  *
  * @param procedure a <code>LongProcedure</code> value
  * @return true if the procedure did not terminate prematurely.
  */
 public boolean forEach(LongProcedure procedure) {
   for (int i = 0; i < pos; i++) if (!procedure.execute(data[i])) return false;
   return true;
 }