com.atlassian.jira.ofbiz
Class DatabaseIterable<E>

java.lang.Object
  extended by com.atlassian.jira.ofbiz.DatabaseIterable<E>
All Implemented Interfaces:
EnclosedIterable<E>, Sized

public abstract class DatabaseIterable<E>
extends Object
implements EnclosedIterable<E>

A abstract implementation of EnclosedIterable that defers to an OfBizListIterator.

Note that the iteration order is up to the query that creates the OfBizListIterator.

This implementation is unbounded.

Since:
v3.13

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.collect.EnclosedIterable
EnclosedIterable.Functions, EnclosedIterable.ListResolver<T>
 
Constructor Summary
DatabaseIterable(int size, Resolver<org.ofbiz.core.entity.GenericValue,E> resolver)
           
 
Method Summary
protected abstract  OfBizListIterator createListIterator()
          Create a new iterator.
 void foreach(Consumer<E> consumer)
          Apply the sink to all elements in the Collection.
 boolean isEmpty()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseIterable

public DatabaseIterable(int size,
                        Resolver<org.ofbiz.core.entity.GenericValue,E> resolver)
Method Detail

foreach

public final void foreach(Consumer<E> consumer)
Description copied from interface: EnclosedIterable
Apply the sink to all elements in the Collection.

Specified by:
foreach in interface EnclosedIterable<E>

size

public final int size()
Specified by:
size in interface EnclosedIterable<E>
Specified by:
size in interface Sized
Returns:
the likely size of the objects passed into the sink in EnclosedIterable.foreach(Consumer). Be careful depending on this size being exact, as in many cases its best efforts value or may be unstable due to concurrent changes.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface EnclosedIterable<E>
Specified by:
isEmpty in interface Sized
Returns:
true if the there is no data behind it.

createListIterator

protected abstract OfBizListIterator createListIterator()
Create a new iterator.

Returns:
an instance of OfBizListIterator


Copyright © 2002-2014 Atlassian. All Rights Reserved.