Class BucketDefinition
- java.lang.Object
-
- net.sf.jasperreports.crosstabs.fill.calculation.BucketDefinition
-
- Direct Known Subclasses:
MultiAxisDataService.PropertiesWrapperBucketDefintion
public class BucketDefinition extends Object
Bucket definition.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBucketDefinition.BucketBucket value class.classBucketDefinition.OrderDecoratorBucket
-
Field Summary
Fields Modifier and Type Field Description protected Comparator<Object>bucketValueComparatorstatic StringEXCEPTION_MESSAGE_KEY_UNSUPPORTED_ORDER_TYPEprotected BucketOrdererordererprotected BucketDefinition.BucketVALUE_NULLThe null bucket.protected BucketDefinition.BucketVALUE_TOTALThe total value for this bucket.protected static byteVALUE_TYPE_NULLValue type used for null bucket values.protected static byteVALUE_TYPE_TOTALValue type used for total buckets.protected static byteVALUE_TYPE_VALUEValue type used for non-null values.
-
Constructor Summary
Constructors Constructor Description BucketDefinition(Class<?> valueClass, BucketOrderer orderer, Comparator<Object> comparator, BucketOrder order, CrosstabTotalPositionEnum totalPosition)Creates a bucket.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancomputeTotal()Whether this bucket needs total calculation.BucketDefinition.Bucketcreate(Object value)Creates aBucketValueobject for a given value.static Comparator<Object>createOrderComparator(Comparator<Object> comparator, BucketOrder order)BucketOrdergetOrder()BucketOrderergetOrderer()CrosstabTotalPositionEnumgetTotalPosition()Returns the total bucket position.booleanisMergeHeaderCells()booleanisSorted()voidsetComputeTotal()Instructs that the bucket will need total bucket calculation.voidsetMergeHeaderCells(boolean mergeHeaderCells)
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_UNSUPPORTED_ORDER_TYPE
public static final String EXCEPTION_MESSAGE_KEY_UNSUPPORTED_ORDER_TYPE
- See Also:
- Constant Field Values
-
VALUE_TYPE_VALUE
protected static final byte VALUE_TYPE_VALUE
Value type used for non-null values.- See Also:
- Constant Field Values
-
VALUE_TYPE_NULL
protected static final byte VALUE_TYPE_NULL
Value type used for null bucket values.- See Also:
- Constant Field Values
-
VALUE_TYPE_TOTAL
protected static final byte VALUE_TYPE_TOTAL
Value type used for total buckets.- See Also:
- Constant Field Values
-
VALUE_TOTAL
protected final BucketDefinition.Bucket VALUE_TOTAL
The total value for this bucket.
-
VALUE_NULL
protected final BucketDefinition.Bucket VALUE_NULL
The null bucket.
-
bucketValueComparator
protected final Comparator<Object> bucketValueComparator
-
orderer
protected final BucketOrderer orderer
-
-
Constructor Detail
-
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 Detail
-
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:
computeTotal()
-
getTotalPosition
public CrosstabTotalPositionEnum getTotalPosition()
Returns the total bucket position.- Returns:
- the total bucket position
-
getOrderer
public BucketOrderer getOrderer()
-
getOrder
public BucketOrder getOrder()
-
isMergeHeaderCells
public boolean isMergeHeaderCells()
-
setMergeHeaderCells
public void setMergeHeaderCells(boolean mergeHeaderCells)
-
create
public BucketDefinition.Bucket create(Object value)
Creates aBucketValueobject for a given value.- Parameters:
value- the value- Returns:
- the corresponding
BucketValueobject
-
-