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 TypeClassDescriptionclassBucket value class.class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Comparator<Object> static final Stringprotected final BucketOrdererprotected final BucketDefinition.BucketThe null bucket.protected final BucketDefinition.BucketThe total value for this bucket.protected static final byteValue type used for null bucket values.protected static final byteValue type used for total buckets.protected static final byteValue 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 TypeMethodDescriptionbooleanWhether this bucket needs total calculation.Creates aBucketValueobject for a given value.static Comparator<Object> createOrderComparator(Comparator<Object> comparator, BucketOrder order) getOrder()Returns the total bucket position.booleanbooleanisSorted()voidInstructs that the bucket will need total bucket calculation.voidsetMergeHeaderCells(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.DESCENDINGorBucketOrder.NONEtotalPosition- 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 aBucketValueobject for a given value.- Parameters:
value- the value- Returns:
- the corresponding
BucketValueobject
-