com.atlassian.jira.util.collect
Class DecoratingIterable

java.lang.Object
  extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.collect.CloseableIterable
CloseableIterable.ListResolver
 
Constructor Summary
DecoratingIterable(CloseableIterable delegate, Resolver decorator)
           
 
Method Summary
 boolean isEmpty()
           
 CloseableIterator iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecoratingIterable

public DecoratingIterable(CloseableIterable delegate,
                          Resolver decorator)
Method Detail

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-2009 Atlassian. All Rights Reserved.