org.xwiki.extension.repository.result
Class AggregatedIterableResult<T>

java.lang.Object
  extended by org.xwiki.extension.repository.result.AggregatedIterableResult<T>
Type Parameters:
T - the type
All Implemented Interfaces:
Iterable<T>, IterableResult<T>

public class AggregatedIterableResult<T>
extends Object
implements IterableResult<T>

Make several iterable results look like one.

Since:
4.0M1
Version:
$Id$

Constructor Summary
AggregatedIterableResult(int offset)
           
 
Method Summary
 void addSearchResult(IterableResult<T> result)
           
 int getOffset()
           
 int getSize()
           
 int getTotalHits()
           
 Iterator<T> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregatedIterableResult

public AggregatedIterableResult(int offset)
Parameters:
offset - the initial offset
Method Detail

addSearchResult

public void addSearchResult(IterableResult<T> result)
Parameters:
result - a iterable result instance to append

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>

getTotalHits

public int getTotalHits()
Specified by:
getTotalHits in interface IterableResult<T>
Returns:
the total number of possible results without offset or maximum results limits

getOffset

public int getOffset()
Specified by:
getOffset in interface IterableResult<T>
Returns:
the index in the total number of possible search result where this extract starts

getSize

public int getSize()
Specified by:
getSize in interface IterableResult<T>
Returns:
the number of found extensions


Copyright © 2004-2012 XWiki. All Rights Reserved.