com.atlassian.jira.util.collect
Class DecoratingIterable
java.lang.Object
com.atlassian.jira.util.collect.DecoratingIterable
- All Implemented Interfaces:
- CloseableIterable, Sized
public class DecoratingIterable
- extends Object
- implements CloseableIterable
CloseableIterable
that takes a decorating function and applies it when returning in the Iterator
.
- Since:
- v3.13
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DecoratingIterable
public DecoratingIterable(CloseableIterable delegate,
Resolver decorator)
iterator
public CloseableIterator iterator()
- Specified by:
iterator
in interface CloseableIterable
- Returns:
- a
CloseableIterator
that can be closed once finished with
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface CloseableIterable
- Returns:
- true if the there is no data behind it. In this case the
CloseableIterable.iterator()
.hasNext() will return false;
size
public int size()
- Specified by:
size
in interface CloseableIterable
- Specified by:
size
in interface Sized
- Returns:
- the likely size of the objects returned by the
CloseableIterable.iterator()
. Be careful depending on this size being exact, as in many cases
its best efforts value or may be stable due to concurrent changes.
Copyright © 2002-2008 Atlassian. All Rights Reserved.