コード例 #1
0
 /** {@inheritDoc} */
 @Override
 public TShortList inverseGrep(TShortProcedure condition) {
   TShortArrayList list = new TShortArrayList();
   for (int i = 0; i < _pos; i++) {
     short val = _data.get(i);
     if (!condition.execute(val)) {
       list.add(val);
     }
   }
   return list;
 }
コード例 #2
0
 /** {@inheritDoc} */
 @Override
 public TShortList 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 > capacity()) {
     throw new IndexOutOfBoundsException("end index < " + capacity());
   }
   TShortArrayList list = new TShortArrayList(end - begin);
   _data.toArray(begin, list._data, 0, end - begin);
   list._pos = end - begin;
   return list;
 }