public final class SubsetPolicy extends Object implements EvaluationPolicy
Query.setPolicy(org.eclipse.stardust.engine.api.query.EvaluationPolicy),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static SubsetPolicy |
COUNT_ONLY
Predefined policy indicating an counting only subset.
|
static SubsetPolicy |
UNRESTRICTED
Predefined policy indicating an unrestricted subset.
|
| Constructor and Description |
|---|
SubsetPolicy(int maxSize)
|
SubsetPolicy(int maxSize,
boolean evaluateTotalCount)
|
SubsetPolicy(int maxSize,
int skippedEntries)
|
SubsetPolicy(int maxSize,
int skippedEntries,
boolean evaluateTotalCount)
Initializes a new subset policy with the explicit values given.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxSize()
Gets the maximum number of items to be included in a query result.
|
int |
getSkippedEntries()
Gets the number of initial items to be skipped before putting items to the query
result.
|
boolean |
isEvaluatingTotalCount()
Indicates if the query result should additionally contain the total number of items
available, disregarding any result set size restriction.
|
static SubsetPolicy |
nextChunk(SubsetPolicy subset)
Creates a new subset policy for retrieving the chunk of data following the one
specified by the given
subset. |
static SubsetPolicy |
previousChunk(SubsetPolicy subset)
Creates a new subset policy for retrieving the chunk of data before the one
specified by the given
subset. |
public static final SubsetPolicy UNRESTRICTED
public static final SubsetPolicy COUNT_ONLY
public SubsetPolicy(int maxSize)
maxSize - The maximum number of items to be retrieved.public SubsetPolicy(int maxSize,
boolean evaluateTotalCount)
maxSize - The maximum number of items to be retrieved.evaluateTotalCount - A flag indicating if the total number of items satisfying
the query is to be evaluated or not.public SubsetPolicy(int maxSize,
int skippedEntries)
maxSize - The maximum number of items to be retrieved.skippedEntries - The number of initial entries to be skipped before putting
items to the query result. Must not be less than 0.org.eclipse.stardust.common.error.PublicException - if skippedEntries is less than 0public SubsetPolicy(int maxSize,
int skippedEntries,
boolean evaluateTotalCount)
maxSize - The maximum number of items to be retrieved.skippedEntries - The number of initial entries to be skipped before putting
items to the query result. Must not be less than 0.evaluateTotalCount - A flag indicating if the total number of items satisfying
the query is to be evaluated or not.org.eclipse.stardust.common.error.PublicException - if skippedEntries is less than 0public static final SubsetPolicy nextChunk(SubsetPolicy subset)
subset.
This chunk is defined as follows:
maxSize = subset.maxSizeskippedEntries = subset.skippedEntries + subset.maxSizeisEvaluatingTotalCount = subset.isEvaluatingTotalCountsubset - The subset specification to find the next chunk for.null if the given
subset was null.previousChunk(org.eclipse.stardust.engine.api.query.SubsetPolicy)public static final SubsetPolicy previousChunk(SubsetPolicy subset)
subset.
This chunk is defined as follows:
maxSize = subset.maxSizeskippedEntries = max(0, subset.skippedEntries - subset.maxSize)isEvaluatingTotalCount = subset.isEvaluatingTotalCountsubset - The subset specification to find the previous chunk for.null if the given
subset was null.nextChunk(org.eclipse.stardust.engine.api.query.SubsetPolicy)public final int getMaxSize()
public final int getSkippedEntries()
public boolean isEvaluatingTotalCount()
true if the total number of items should be evaluated,
false if not.Copyright © 2016 Eclipse Stardust. All Rights Reserved.