Пример #1
0
 @Override
 public PList<Integer> extendAt(int i, PList<Integer> extra) {
   if (extra instanceof IntList) {
     IntList other = (IntList) extra;
     ensureNMore((other.size() + i) - this.size());
     System.arraycopy(other.box, 0, box, i, extra.size());
     if (i + other.size > size) size = i + other.size;
   } else {
     for (Integer b : extra) {
       this.set(i, b);
     }
   }
   return null;
 }
Пример #2
0
 @Override
 public PList<Integer> extend(PList<Integer> extra) {
   if (extra instanceof IntList) {
     IntList other = (IntList) extra;
     ensureNMore(other.size());
     System.arraycopy(other.box, 0, box, size, extra.size());
     size += other.size;
   } else {
     for (Integer b : extra) {
       this.add(b);
     }
   }
   return null;
 }