Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 3
0
 @Override
 public void replaceBy(PList<?> newList) {
   box = ((IntList) newList).box;
   size = newList.size();
 }