|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.util.itr.AbstractIterator<T,U>
org.entityfs.util.itr.LocationAwareDepthLastIteratorImpl
public class LocationAwareDepthLastIteratorImpl
This is an implementation of DepthLastIterator
that returns
EntityAndRelativeLocation
objects. The location of the returned
objects is the relative location of the entity to the root directory of the
iteration.
This class should perhaps have been named LocationAwareBreadthFirstIteratorImpl
...
EntityFS iterators are not thread safe. Don't use them concurrently from several threads without synchronizing access to them.
DepthLastIteratorImpl
,
LocationAwareDepthFirstIteratorImpl
Constructor Summary | |
---|---|
LocationAwareDepthLastIteratorImpl(EntityListable dv,
boolean returnThis)
Create a new depth-last (breadth-first) iterator. |
|
LocationAwareDepthLastIteratorImpl(EntityListable dv,
Filter<? super EntityView> filter,
boolean returnThis)
Create a new depth-last (breadth-first) iterator. |
Method Summary | |
---|---|
protected LocationAwareDepthLastIteratorContextImpl |
createChildIteratorContext(EntityAndRelativeLocation<EntityView> earl,
LocationAwareDepthLastIteratorContextImpl parentContext)
|
protected EntityAndRelativeLocation<EntityView> |
getObjectForRootDirectory(DirectoryView rootDirectory)
Get an object to return from the iterator for the root directory of the recursive iteration. |
protected boolean |
testAndSetNext()
|
Methods inherited from class org.entityfs.util.itr.AbstractIterator |
---|
getContextStack, getFilter, hasNext, next, remove, setNext, testAndSetNextChildEntity, testAndSetNextSubdirectory |
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 |
---|
hasNext, next, remove |
Constructor Detail |
---|
public LocationAwareDepthLastIteratorImpl(EntityListable dv, Filter<? super EntityView> filter, boolean returnThis)
dv
- The start directory for the iterator. If returnThis
is
true
, this argument must be a DirectoryView
(such as a Directory
.filter
- The filter that entities must pass to be returned from the
iterator. The iterator will not visit subdirectories that do not pass
this filter.returnThis
- Should the starting directory be returned as the first
entity from the iterator (if it passes the filter)?public LocationAwareDepthLastIteratorImpl(EntityListable dv, boolean returnThis)
dv
- The start directory for the iterator. If returnThis
is
true
, this argument must be a DirectoryView
(such as a Directory
.returnThis
- Should the starting directory be returned as the first
entity from the iterator?Method Detail |
---|
protected LocationAwareDepthLastIteratorContextImpl createChildIteratorContext(EntityAndRelativeLocation<EntityView> earl, LocationAwareDepthLastIteratorContextImpl parentContext)
createChildIteratorContext
in class AbstractIterator<LocationAwareDepthLastIteratorContextImpl,EntityAndRelativeLocation<EntityView>>
protected EntityAndRelativeLocation<EntityView> getObjectForRootDirectory(DirectoryView rootDirectory)
DepthLastIteratorContext.testAndClearShouldReturnThis()
returns
true
for the current context.
rootDirectory
- The root directory of the iteration.protected final boolean testAndSetNext()
testAndSetNext
in class AbstractIterator<T extends org.entityfs.util.itr.DepthLastIteratorContext<U>,U>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |