Class BucketDefinition
java.lang.Object
net.sf.jasperreports.crosstabs.fill.calculation.BucketDefinition
- Direct Known Subclasses:
MultiAxisDataService.PropertiesWrapperBucketDefintion
Bucket definition.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Bucket value class.class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Comparator
<Object> static final String
protected final BucketOrderer
protected final BucketDefinition.Bucket
The null bucket.protected final BucketDefinition.Bucket
The total value for this bucket.protected static final byte
Value type used for null bucket values.protected static final byte
Value type used for total buckets.protected static final byte
Value type used for non-null values. -
Constructor Summary
ConstructorsConstructorDescriptionBucketDefinition
(Class<?> valueClass, BucketOrderer orderer, Comparator<Object> comparator, BucketOrder order, CrosstabTotalPositionEnum totalPosition) Creates a bucket. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether this bucket needs total calculation.Creates aBucketValue
object for a given value.static Comparator
<Object> createOrderComparator
(Comparator<Object> comparator, BucketOrder order) getOrder()
Returns the total bucket position.boolean
boolean
isSorted()
void
Instructs that the bucket will need total bucket calculation.void
setMergeHeaderCells
(boolean mergeHeaderCells)
-
Field Details
-
EXCEPTION_MESSAGE_KEY_UNSUPPORTED_ORDER_TYPE
- See Also:
-
VALUE_TYPE_VALUE
protected static final byte VALUE_TYPE_VALUEValue type used for non-null values.- See Also:
-
VALUE_TYPE_NULL
protected static final byte VALUE_TYPE_NULLValue type used for null bucket values.- See Also:
-
VALUE_TYPE_TOTAL
protected static final byte VALUE_TYPE_TOTALValue type used for total buckets.- See Also:
-
VALUE_TOTAL
The total value for this bucket. -
VALUE_NULL
The null bucket. -
bucketValueComparator
-
orderer
-
-
Constructor Details
-
BucketDefinition
public BucketDefinition(Class<?> valueClass, BucketOrderer orderer, Comparator<Object> comparator, BucketOrder order, CrosstabTotalPositionEnum totalPosition) throws JRException Creates a bucket.- Parameters:
valueClass
- the class of the bucket valuesorderer
- bucket entries orderercomparator
- the comparator to use for bucket sortingorder
- the order type,BucketOrder.ASCENDING
,BucketOrder.DESCENDING
orBucketOrder.NONE
totalPosition
- the position of the total bucket- Throws:
JRException
-
-
Method Details
-
createOrderComparator
public static Comparator<Object> createOrderComparator(Comparator<Object> comparator, BucketOrder order) -
isSorted
public boolean isSorted() -
computeTotal
public boolean computeTotal()Whether this bucket needs total calculation.- Returns:
- this bucket needs total calculation
-
setComputeTotal
public void setComputeTotal()Instructs that the bucket will need total bucket calculation.- See Also:
-
getTotalPosition
Returns the total bucket position.- Returns:
- the total bucket position
-
getOrderer
-
getOrder
-
isMergeHeaderCells
public boolean isMergeHeaderCells() -
setMergeHeaderCells
public void setMergeHeaderCells(boolean mergeHeaderCells) -
create
Creates aBucketValue
object for a given value.- Parameters:
value
- the value- Returns:
- the corresponding
BucketValue
object
-