org.xwiki.extension.wrap
Class WrappingIterableResult<E extends Extension>

java.lang.Object
  extended by org.xwiki.extension.wrap.AbstractWrappingObject<T>
      extended by org.xwiki.extension.internal.safe.AbstractSafeObject<IterableResult<E>>
          extended by org.xwiki.extension.wrap.WrappingIterableResult<E>
Type Parameters:
E - the extension type
All Implemented Interfaces:
Iterable<E>, IterableResult<E>

public class WrappingIterableResult<E extends Extension>
extends org.xwiki.extension.internal.safe.AbstractSafeObject<IterableResult<E>>
implements IterableResult<E>

Provide a public script access to a iterable result.

Since:
4.0M2
Version:
$Id: 401ee1bc110a75b4447e05704de468cced7fb51d $

Field Summary
 
Fields inherited from class org.xwiki.extension.internal.safe.AbstractSafeObject
FORBIDDEN, safeProvider
 
Constructor Summary
WrappingIterableResult(IterableResult<E> result, org.xwiki.extension.internal.safe.ScriptSafeProvider<?> safeProvider)
           
 
Method Summary
 int getOffset()
           
 int getSize()
           
 int getTotalHits()
           
 Iterator<E> iterator()
           
 
Methods inherited from class org.xwiki.extension.internal.safe.AbstractSafeObject
safe
 
Methods inherited from class org.xwiki.extension.wrap.AbstractWrappingObject
equals, getWrapped, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappingIterableResult

public WrappingIterableResult(IterableResult<E> result,
                              org.xwiki.extension.internal.safe.ScriptSafeProvider<?> safeProvider)
Parameters:
result - the wrapped result
safeProvider - the provider of instances safe for public scripts
Method Detail

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E extends Extension>

getTotalHits

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

getOffset

public int getOffset()
Specified by:
getOffset in interface IterableResult<E extends Extension>
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<E extends Extension>
Returns:
the number of found extensions


Copyright © 2004-2013 XWiki. All Rights Reserved.