QueryRange

To support paging of query results, specifies an offset/start instance and limits the number of instances to be retrieved.

Used by NamedQuery#withRange(QueryRange) and AllInstancesQuery#withRange(QueryRange) .

API

QueryRange.java
interface QueryRange {
  boolean isUnconstrained()     (1)
  boolean hasOffset()     (2)
  boolean hasLimit()     (3)
  long getStart()     (4)
  long getLimit()     (5)
  long getEnd()     (6)
  int getStartAsInt()     (7)
  int getLimitAsInt()     (8)
  int getEndAsInt()     (9)
  QueryRange unconstrained()
  QueryRange start(long start)
  QueryRange limit(long limit)
  QueryRange of(long... range)
  QueryRange withStart(long start)
  QueryRange withLimit(long limit)
}
1 isUnconstrained()

Whether this range is unconstrained, meaning that there is #hasOffset() no offset and #hasLimit() no limit has been specified.

2 hasOffset()

Whether this range has had a non-zero offset specified using #withStart(long) .

3 hasLimit()

Whether this range has a limit to the number of instances to be returned using #withLimit(long) .

4 getStart()

The start index into the set table. (non-negative)

5 getLimit()

The maximum number of items to return, starting at #getStart() (non-negative).

6 getEnd()

The end index into the set table. Overflow is ignored. (non-negative)

7 getStartAsInt()

The start index into the set table (as java int primitive)

8 getLimitAsInt()

The maximum number of items to return (as java int primitive) if limit overflows an int, Integer#MAX_VALUE is returned.

9 getEndAsInt()

The end index into the set table. Overflow is ignored. (as java int primitive) if end overflows an int, Integer#MAX_VALUE is returned.

Members

isUnconstrained()

Whether this range is unconstrained, meaning that there is #hasOffset() no offset and #hasLimit() no limit has been specified.

hasOffset()

Whether this range has had a non-zero offset specified using #withStart(long) .

hasLimit()

Whether this range has a limit to the number of instances to be returned using #withLimit(long) .

getStart()

The start index into the set table. (non-negative)

getLimit()

The maximum number of items to return, starting at #getStart() (non-negative).

getEnd()

The end index into the set table. Overflow is ignored. (non-negative)

getStartAsInt()

The start index into the set table (as java int primitive)

getLimitAsInt()

The maximum number of items to return (as java int primitive) if limit overflows an int, Integer#MAX_VALUE is returned.

getEndAsInt()

The end index into the set table. Overflow is ignored. (as java int primitive) if end overflows an int, Integer#MAX_VALUE is returned.