com.xpn.xwiki.criteria.impl
Class RangeFactory

java.lang.Object
  extended by com.xpn.xwiki.criteria.impl.RangeFactory

public class RangeFactory
extends Object

Helper factory class for creating Range objects in velocity


Field Summary
static Range ALL
          The interval that matches the entire list it is applied to.
static Range FIRST
          The interval that matches just the first element of the list it is applied to.
static Range LAST
          The interval that matches just the last element of the list it is applied to.
 
Constructor Summary
RangeFactory()
           
 
Method Summary
static Range createAllRange()
          Creates a new Range which matches all the elements of the list it is applied to.
static Range createHeadRange(int size)
          Creates a new Range starting from 0 and having the specified size.
static Range createRange(int start, int size)
           
static Range createTailRange(int size)
          Creates a new Range starting from the end of the list it is applied to and having the specified size.
static Range getALL()
          Helper method for accessing ALL static field in velocity
static Range getFIRST()
          Helper method for accessing FIRST static field in velocity
static Range getLAST()
          Helper method for accessing LAST static field in velocity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final Range ALL
The interval that matches the entire list it is applied to.


FIRST

public static final Range FIRST
The interval that matches just the first element of the list it is applied to.


LAST

public static final Range LAST
The interval that matches just the last element of the list it is applied to.

Constructor Detail

RangeFactory

public RangeFactory()
Method Detail

createRange

public static Range createRange(int start,
                                int size)
See Also:
Range.Range(int, int)

createAllRange

public static Range createAllRange()
Creates a new Range which matches all the elements of the list it is applied to.

Returns:
A new Range instance

createHeadRange

public static Range createHeadRange(int size)
Creates a new Range starting from 0 and having the specified size. It matches the first size elements of the list it is applied to.

Parameters:
size - The size of the interval
Returns:
A new Range instance

createTailRange

public static Range createTailRange(int size)
Creates a new Range starting from the end of the list it is applied to and having the specified size. It matches the last size elements of the list.

Parameters:
size - The size of the interval
Returns:
A new Range instance

getALL

public static Range getALL()
Helper method for accessing ALL static field in velocity


getFIRST

public static Range getFIRST()
Helper method for accessing FIRST static field in velocity


getLAST

public static Range getLAST()
Helper method for accessing LAST static field in velocity



Copyright © 2004-2013 XWiki. All Rights Reserved.