public class BucketDefinition extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
BucketDefinition.Bucket
Bucket value class.
|
class |
BucketDefinition.OrderDecoratorBucket |
| Modifier and Type | Field and Description |
|---|---|
protected Comparator<Object> |
bucketValueComparator |
protected BucketOrderer |
orderer |
protected BucketDefinition.Bucket |
VALUE_NULL
The null bucket.
|
protected BucketDefinition.Bucket |
VALUE_TOTAL
The total value for this bucket.
|
protected static byte |
VALUE_TYPE_NULL
Value type used for null bucket values.
|
protected static byte |
VALUE_TYPE_TOTAL
Value type used for total buckets.
|
protected static byte |
VALUE_TYPE_VALUE
Value type used for non-null values.
|
| Constructor and Description |
|---|
BucketDefinition(Class<?> valueClass,
BucketOrderer orderer,
Comparator<Object> comparator,
BucketOrder order,
CrosstabTotalPositionEnum totalPosition)
Creates a bucket.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
computeTotal()
Whether this bucket needs total calculation.
|
BucketDefinition.Bucket |
create(Object value)
Creates a
BucketValue object for a given value. |
static Comparator<Object> |
createOrderComparator(Comparator<Object> comparator,
BucketOrder order) |
BucketOrder |
getOrder() |
BucketOrderer |
getOrderer() |
CrosstabTotalPositionEnum |
getTotalPosition()
Returns the total bucket position.
|
boolean |
isSorted() |
void |
setComputeTotal()
Instructs that the bucket will need total bucket calculation.
|
protected static final byte VALUE_TYPE_VALUE
protected static final byte VALUE_TYPE_NULL
protected static final byte VALUE_TYPE_TOTAL
protected final BucketDefinition.Bucket VALUE_TOTAL
protected final BucketDefinition.Bucket VALUE_NULL
protected final Comparator<Object> bucketValueComparator
protected final BucketOrderer orderer
public BucketDefinition(Class<?> valueClass, BucketOrderer orderer, Comparator<Object> comparator, BucketOrder order, CrosstabTotalPositionEnum totalPosition) throws JRException
valueClass - the class of the bucket valuesorderer - bucket entries orderercomparator - the comparator to use for bucket sortingorder - the order type, BucketOrder.ASCENDING, BucketOrder.DESCENDING or BucketOrder.NONEtotalPosition - the position of the total bucketJRExceptionpublic static Comparator<Object> createOrderComparator(Comparator<Object> comparator, BucketOrder order)
public boolean isSorted()
public boolean computeTotal()
public void setComputeTotal()
computeTotal()public CrosstabTotalPositionEnum getTotalPosition()
public BucketOrderer getOrderer()
public BucketOrder getOrder()
public BucketDefinition.Bucket create(Object value)
BucketValue object for a given value.value - the valueBucketValue objectCopyright © 2014. All rights reserved.