Exemple #1
0
 /**
  * Executes <tt>procedure</tt> for each element in the set.
  *
  * @param procedure a <code>TObjectProcedure</code> value
  * @return false if the loop over the set terminated because the procedure returned false for some
  *     value.
  */
 public boolean forEach(TCharProcedure procedure) {
   byte[] states = _states;
   char[] set = _set;
   for (int i = set.length; i-- > 0; ) {
     if (states[i] == FULL && !procedure.execute(set[i])) {
       return false;
     }
   }
   return true;
 }
 /** {@inheritDoc} */
 public boolean forEachValue(TCharProcedure procedure) {
   byte[] states = _states;
   char[] values = _values;
   for (int i = values.length; i-- > 0; ) {
     if (states[i] == FULL && !procedure.execute(values[i])) {
       return false;
     }
   }
   return true;
 }
 /** {@inheritDoc} */
 @Override
 public boolean forEachValue(TCharProcedure procedure) {
   TByteOffheapArray states = _states;
   TCharOffheapArray values = _values;
   for (int i = capacity(); i-- > 0; ) {
     if (states.get(i) == FULL && !procedure.execute(values.get(i))) {
       return false;
     }
   }
   return true;
 }