Package com.google.protobuf
Class RopeByteString.PieceIterator
java.lang.Object
com.google.protobuf.RopeByteString.PieceIterator
- All Implemented Interfaces:
Iterator<ByteString.LeafByteString>
- Enclosing class:
RopeByteString
private static final class RopeByteString.PieceIterator
extends Object
implements Iterator<ByteString.LeafByteString>
This class is a continuable tree traversal, which keeps the state information which would exist
on the stack in a recursive traversal instead on a stack of "Bread Crumbs". The maximum depth
of the stack in this iterator is the same as the depth of the tree being traversed.
This iterator is used to implement RopeByteString.equalsFragments(ByteString)
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayDeque
<RopeByteString> private ByteString.LeafByteString
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ByteString.LeafByteString
getLeafByLeft
(ByteString root) private ByteString.LeafByteString
boolean
hasNext()
next()
Returns the next item and advances oneByteString.LeafByteString
.void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
breadCrumbs
-
next
-
-
Constructor Details
-
PieceIterator
-
-
Method Details
-
getLeafByLeft
-
getNextNonEmptyLeaf
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<ByteString.LeafByteString>
-
next
Returns the next item and advances oneByteString.LeafByteString
.- Specified by:
next
in interfaceIterator<ByteString.LeafByteString>
- Returns:
- next non-empty LeafByteString or
null
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<ByteString.LeafByteString>
-