Ejemplo n.º 1
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.º 2
0
 /** {@inheritDoc} */
 public TByteList subList(int begin, int end) {
   if (end < begin) {
     throw new IllegalArgumentException("end index " + end + " greater than begin index " + begin);
   }
   if (begin < 0) {
     throw new IndexOutOfBoundsException("begin index can not be < 0");
   }
   if (end > _data.length) {
     throw new IndexOutOfBoundsException("end index < " + _data.length);
   }
   TByteArrayList list = new TByteArrayList(end - begin);
   for (int i = begin; i < end; i++) {
     list.add(_data[i]);
   }
   return list;
 }