/** {@inheritDoc} */ @Override public void back(int delta) { while (--delta >= 0) { if (currentSubtree != null) nextSubtreePos--; ptr--; parseEntry(false); if (currentSubtree != null) ptr -= currentSubtree.getEntrySpan() - 1; } }
DirCacheIterator(DirCacheIterator p, DirCacheTree dct) { super(p, p.path, p.pathLen + 1); cache = p.cache; tree = dct; treeStart = p.ptr; treeEnd = treeStart + tree.getEntrySpan(); subtreeId = p.subtreeId; ptr = p.ptr; parseEntry(); }
/** {@inheritDoc} */ @Override public void next(int delta) { while (--delta >= 0) { if (currentSubtree != null) ptr += currentSubtree.getEntrySpan(); else ptr++; if (eof()) break; parseEntry(); } }
/** {@inheritDoc} */ @Override public void skip() throws CorruptObjectException { if (currentSubtree != null) builder.keep(ptr, currentSubtree.getEntrySpan()); else builder.keep(ptr, 1); next(1); }
/** * Create a new iterator for an already loaded DirCache instance. * <p> * The iterator implementation may copy part of the cache's data during * construction, so the cache must be read in prior to creating the * iterator. * * @param dc * the cache to walk. It must be already loaded into memory. */ public DirCacheIterator(DirCache dc) { cache = dc; tree = dc.getCacheTree(true); treeStart = 0; treeEnd = tree.getEntrySpan(); subtreeId = new byte[Constants.OBJECT_ID_LENGTH]; if (!eof()) parseEntry(); }
@Override public void back(int delta) { while (--delta >= 0) { if (currentSubtree != null) nextSubtreePos--; ptr--; parseEntry(false); if (currentSubtree != null) ptr -= currentSubtree.getEntrySpan() - 1; } }
DirCacheIterator(final DirCacheIterator p, final DirCacheTree dct) { super(p, p.path, p.pathLen + 1); cache = p.cache; tree = dct; treeStart = p.ptr; treeEnd = treeStart + tree.getEntrySpan(); subtreeId = p.subtreeId; ptr = p.ptr; parseEntry(); }
DirCacheIterator(DirCacheIterator p, DirCacheTree dct) { super(p, p.path, p.pathLen + 1); cache = p.cache; tree = dct; treeStart = p.ptr; treeEnd = treeStart + tree.getEntrySpan(); subtreeId = p.subtreeId; ptr = p.ptr; parseEntry(); }
/** {@inheritDoc} */ @Override public void back(int delta) { while (--delta >= 0) { if (currentSubtree != null) nextSubtreePos--; ptr--; parseEntry(false); if (currentSubtree != null) ptr -= currentSubtree.getEntrySpan() - 1; } }
@Override public void next(int delta) { while (--delta >= 0) { if (currentSubtree != null) ptr += currentSubtree.getEntrySpan(); else ptr++; if (eof()) break; parseEntry(); } }
/** {@inheritDoc} */ @Override public void next(int delta) { while (--delta >= 0) { if (currentSubtree != null) ptr += currentSubtree.getEntrySpan(); else ptr++; if (eof()) break; parseEntry(); } }
@Override public void skip() throws CorruptObjectException { if (currentSubtree != null) builder.keep(ptr, currentSubtree.getEntrySpan()); else builder.keep(ptr, 1); next(1); }
/** {@inheritDoc} */ @Override public void skip() throws CorruptObjectException { if (currentSubtree != null) builder.keep(ptr, currentSubtree.getEntrySpan()); else builder.keep(ptr, 1); next(1); }
private void show(final DirCacheTree tree) throws IOException { outw.println(MessageFormat.format(CLIText.get().cacheTreePathInfo, tree.getPathString(), valueOf(tree.getEntrySpan()), valueOf(tree.getChildCount()))); for (int i = 0; i < tree.getChildCount(); i++) show(tree.getChild(i)); } }
private void show(final DirCacheTree tree) throws IOException { outw.println(MessageFormat.format(CLIText.get().cacheTreePathInfo, tree.getPathString(), valueOf(tree.getEntrySpan()), valueOf(tree.getChildCount()))); for (int i = 0; i < tree.getChildCount(); i++) show(tree.getChild(i)); } }
/** * Create a new iterator for an already loaded DirCache instance. * <p> * The iterator implementation may copy part of the cache's data during * construction, so the cache must be read in prior to creating the * iterator. * * @param dc * the cache to walk. It must be already loaded into memory. */ public DirCacheIterator(final DirCache dc) { cache = dc; tree = dc.getCacheTree(true); treeStart = 0; treeEnd = tree.getEntrySpan(); subtreeId = new byte[Constants.OBJECT_ID_LENGTH]; if (!eof()) parseEntry(); }
/** * Create a new iterator for an already loaded DirCache instance. * <p> * The iterator implementation may copy part of the cache's data during * construction, so the cache must be read in prior to creating the * iterator. * * @param dc * the cache to walk. It must be already loaded into memory. */ public DirCacheIterator(DirCache dc) { cache = dc; tree = dc.getCacheTree(true); treeStart = 0; treeEnd = tree.getEntrySpan(); subtreeId = new byte[Constants.OBJECT_ID_LENGTH]; if (!eof()) parseEntry(); }