Exemplo n.º 1
0
 /**
  * Returns a shallow copy of this <tt>ArrayList</tt> instance. (The elements themselves are not
  * copied.)
  *
  * @return a clone of this <tt>ArrayList</tt> instance
  */
 @Override
 public Object clone() {
   try {
     @SuppressWarnings("unchecked")
     FloatArrayList v = (FloatArrayList) super.clone();
     v.elementData = Arrays.copyOf(elementData, size);
     v.modCount = 0;
     return v;
   } catch (CloneNotSupportedException e) {
     // this shouldn't happen, since we are Cloneable
     throw new InternalError();
   }
 }
Exemplo n.º 2
0
 @Override
 protected void removeRange(int fromIndex, int toIndex) {
   checkForComodification();
   parent.removeRange(parentOffset + fromIndex, parentOffset + toIndex);
   this.modCount = parent.modCount;
   this.size -= toIndex - fromIndex;
 }
Exemplo n.º 3
0
 @Override
 public void add(int index, Float e) {
   rangeCheckForAdd(index);
   checkForComodification();
   parent.add(parentOffset + index, e);
   this.modCount = parent.modCount;
   this.size++;
 }
Exemplo n.º 4
0
 @Override
 public Float remove(int index) {
   rangeCheck(index);
   checkForComodification();
   Float result = parent.remove(parentOffset + index);
   this.modCount = parent.modCount;
   this.size--;
   return result;
 }
Exemplo n.º 5
0
    @Override
    public boolean addAll(int index, Collection<? extends Float> c) {
      rangeCheckForAdd(index);
      int cSize = c.size();
      if (cSize == 0) return false;

      checkForComodification();
      parent.addAll(parentOffset + index, c);
      this.modCount = parent.modCount;
      this.size += cSize;
      return true;
    }