Refactor AbstractTreeIterator semantics to start on first entry
commite2fc776b081b3c2417db38afcba2e8eeac7f4e21
authorShawn O. Pearce <spearce@spearce.org>
Mon, 18 Aug 2008 23:53:17 +0000 (18 16:53 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 20 Aug 2008 21:07:32 +0000 (20 23:07 +0200)
tree3c38859b2ad5f73ff1260fd27b65d495f04e03f5
parentd19c17325f1e852ed9e1d3c7531a686851bc2ba4
Refactor AbstractTreeIterator semantics to start on first entry

The AbstractTreeIterator implementations now start on their first
entry at construction time, instead of relying on TreeWalk to do
an initial "next()" invocation.  This cleans up some of the code
and makes the iterators more consistent with each other.

In all implementations the refactoring splits out the advance
portion of next() from the entry parsing portion.  This change
(along with the position semantic change) will permit us to do
reverse iteration in the future, making the iterators all able
to be bi-directional.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.egit.core/src/org/spearce/egit/core/ContainerTreeIterator.java
org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheBuilderIteratorTest.java
org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheIteratorTest.java
org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheBuildIterator.java
org.spearce.jgit/src/org/spearce/jgit/dircache/DirCacheIterator.java
org.spearce.jgit/src/org/spearce/jgit/treewalk/AbstractTreeIterator.java
org.spearce.jgit/src/org/spearce/jgit/treewalk/CanonicalTreeParser.java
org.spearce.jgit/src/org/spearce/jgit/treewalk/FileTreeIterator.java
org.spearce.jgit/src/org/spearce/jgit/treewalk/TreeWalk.java
org.spearce.jgit/src/org/spearce/jgit/treewalk/WorkingTreeIterator.java