Class PathParentIterator
- java.lang.Object
-
- org.apache.zookeeper.server.watch.PathParentIterator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<String>
asIterable()
Return an Iterable view so that this Iterator can be used in for each statements.boolean
atParentPath()
Returns true if this iterator is currently at a parent path as opposed to the initial path given to the constructorstatic PathParentIterator
forAll(String path)
Return a new PathParentIterator that iterates from the given path to all parents.static PathParentIterator
forPathOnly(String path)
Return a new PathParentIterator that only returns the given path - i.e.boolean
hasNext()
String
next()
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
-
-
-
-
Method Detail
-
forAll
public static PathParentIterator forAll(String path)
Return a new PathParentIterator that iterates from the given path to all parents.- Parameters:
path
- initial path
-
forPathOnly
public static PathParentIterator forPathOnly(String path)
Return a new PathParentIterator that only returns the given path - i.e. does not iterate to parent paths.- Parameters:
path
- initial path
-
asIterable
public Iterable<String> asIterable()
Return an Iterable view so that this Iterator can be used in for each statements. IMPORTANT: the returned Iterable is single use only- Returns:
- Iterable
-
atParentPath
public boolean atParentPath()
Returns true if this iterator is currently at a parent path as opposed to the initial path given to the constructor- Returns:
- true/false
-
-