@Override public boolean hasNext() { return iterator.hasNext(); }
@Override public int next() { return iterator.next(); }
@Override public boolean removeAllOrNone(PackBitmapIndex index) { if (!bitmapIndex.packIndex.equals(index)) return false; EWAHCompressedBitmap curr = bitset.combine() .xor(ones(bitmapIndex.indexObjectCount)); IntIterator ii = curr.intIterator(); if (ii.hasNext() && ii.next() < bitmapIndex.indexObjectCount) return false; bitset = new ComboBitset(curr); return true; }
/** {@inheritDoc} */ @Override public EWAHCompressedBitmap getBitmap(AnyObjectId objectId) { EWAHCompressedBitmap bitmap = newPackIndex.getBitmap(objectId); if (bitmap != null || oldPackIndex == null) return bitmap; StoredBitmap stored = convertedBitmaps.get(objectId); if (stored != null) return stored.getBitmap(); StoredBitmap oldBitmap = oldPackIndex.getBitmaps().get(objectId); if (oldBitmap == null) return null; if (newPackIndex.findPosition(objectId) == -1) return null; inflated.clear(); for (IntIterator i = oldBitmap.getBitmap().intIterator(); i.hasNext();) inflated.set(prevToNewMapping[i.next()]); bitmap = inflated.toEWAHCompressedBitmap(); bitmap.trim(); convertedBitmaps.add( new StoredBitmap(objectId, bitmap, null, oldBitmap.getFlags())); return bitmap; }
@Override public int last() { return bitmap.reverseIntIterator().next(); }
@Override public boolean hasNext() { if (!cached.hasNext()) { if (commits.hasNext()) { type = Constants.OBJ_COMMIT; cached = commits; } else if (trees.hasNext()) { type = Constants.OBJ_TREE; cached = trees; } else if (blobs.hasNext()) { type = Constants.OBJ_BLOB; cached = blobs; } else if (tags.hasNext()) { type = Constants.OBJ_TAG; cached = tags; } else { return false; } } return true; }
@Override public int last() { return bitmap.reverseIntIterator().next(); }
@Override public boolean hasNext() { return this.under.hasNext(); }
@Override public BitmapObject next() { if (!hasNext()) throw new NoSuchElementException(); int position = cached.next(); if (position < bitmapIndex.indexObjectCount) { out.type = type; out.objectId = bitmapIndex.packIndex.getObject(position); } else { position -= bitmapIndex.indexObjectCount; MutableEntry entry = bitmapIndex.mutableIndex.getObject(position); out.type = entry.type; out.objectId = entry; } return out; }
@Override public boolean hasNext() { return this.under.hasNext(); }
@Override public Integer next() { return this.under.next(); }
@Override public boolean hasNext() { return this.under.hasNext(); }
@Override public Integer next() { return this.under.next(); }
@Override public boolean hasNext() { return this.under.hasNext(); }
/** * A string describing the bitmap. * * @return the string */ @Override public String toString() { StringBuilder answer = new StringBuilder(); IntIterator i = this.intIterator(); answer.append("{"); if (i.hasNext()) answer.append(i.next()); while (i.hasNext()) { answer.append(","); answer.append(i.next()); } answer.append("}"); return answer.toString(); }