Example #1
0
 public boolean addAll(int index, ByteList list) {
   checkIndex(index);
   ensureCapacity(list.size());
   int toMove = this.size() - index;
   System.arraycopy(
       this.underlyingArray, index, this.underlyingArray, index + list.size(), toMove);
   System.arraycopy(list.underlyingArray, 0, this.underlyingArray, index, list.size());
   this.pos += list.size();
   return true;
 }
Example #2
0
 public boolean containsAll(ByteList c) {
   for (int i = 0; i != c.size(); ++i) {
     if (!this.contains(c.get(i))) {
       return false;
     }
   }
   return true;
 }
Example #3
0
 public boolean removeAll(ByteList list) {
   boolean removed = false;
   for (int i = 0; i != list.size(); ++i) {
     byte val = list.get(i);
     while (this.remove(val)) {
       removed = true;
     }
   }
   return removed;
 }
 public boolean equals(Object that) {
   if (this == that) {
     return true;
   } else if (that instanceof ByteList) {
     ByteList thatList = (ByteList) that;
     if (size() != thatList.size()) {
       return false;
     }
     for (ByteIterator thatIter = thatList.iterator(), thisIter = iterator();
         thisIter.hasNext(); ) {
       if (thisIter.next() != thatIter.next()) {
         return false;
       }
     }
     return true;
   } else {
     return false;
   }
 }
/*     */     public boolean addAll(long index, ByteList l) {
/* 588 */       ensureIndex(index);
/* 589 */       this.to += l.size();
/*     */ 
/* 595 */       return this.l.addAll(this.from + index, l);
/*     */     }
Example #6
0
 public boolean addAll(ByteList list) {
   ensureCapacity(list.size());
   System.arraycopy(list.underlyingArray, 0, this.underlyingArray, this.size(), list.size());
   this.pos += list.size();
   return true;
 }
Example #7
0
 boolean hasNext() {
   return this.pos < list.size();
 }