Ejemplo n.º 1
0
 /** {@inheritDoc} */
 public boolean forEach(TByteProcedure procedure) {
   for (int i = 0; i < _pos; i++) {
     if (!procedure.execute(_data[i])) {
       return false;
     }
   }
   return true;
 }
Ejemplo n.º 2
0
 /** {@inheritDoc} */
 public boolean forEachDescending(TByteProcedure procedure) {
   for (int i = _pos; i-- > 0; ) {
     if (!procedure.execute(_data[i])) {
       return false;
     }
   }
   return true;
 }
Ejemplo n.º 3
0
 /** {@inheritDoc} */
 public TByteList inverseGrep(TByteProcedure condition) {
   TByteArrayList list = new TByteArrayList();
   for (int i = 0; i < _pos; i++) {
     if (!condition.execute(_data[i])) {
       list.add(_data[i]);
     }
   }
   return list;
 }
Ejemplo n.º 4
0
 /** {@inheritDoc} */
 public boolean forEachValue(TByteProcedure procedure) {
   byte[] states = _states;
   byte[] values = _values;
   for (int i = values.length; i-- > 0; ) {
     if (states[i] == FULL && !procedure.execute(values[i])) {
       return false;
     }
   }
   return true;
 }
Ejemplo n.º 5
0
 /**
  * Executes <tt>procedure</tt> for each key in the map.
  *
  * @param procedure a <code>TByteProcedure</code> value
  * @return false if the loop over the set terminated because the procedure returned false for some
  *     value.
  */
 public boolean forEach(TByteProcedure procedure) {
   byte[] states = _states;
   byte[] set = _set;
   for (int i = set.length; i-- > 0; ) {
     if (states[i] == FULL && !procedure.execute(set[i])) {
       return false;
     }
   }
   return true;
 }