net.sf.jasperreports.crosstabs.fill.calculation
Class BucketDefinition

java.lang.Object
  extended by net.sf.jasperreports.crosstabs.fill.calculation.BucketDefinition

public class BucketDefinition
extends java.lang.Object

Bucket definition.

Version:
$Id: BucketDefinition.java 1229 2006-04-19 10:27:35Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Nested Class Summary
 class BucketDefinition.Bucket
          Bucket value class.
 
Field Summary
protected  java.util.Comparator comparator
           
static byte ORDER_ASCENDING
          Ascending order constant.
static byte ORDER_DESCENDING
          Descending order constant.
static byte TOTAL_POSITION_END
          Constants indicating that totals are to be positioned at the end of the other buckets.
static byte TOTAL_POSITION_NONE
          Constant indicating that total are not required for this bucket.
static byte TOTAL_POSITION_START
          Constants indicating that totals are to be positioned before the other buckets.
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 Summary
BucketDefinition(java.lang.Class valueClass, java.util.Comparator comparator, byte order, byte totalPosition)
          Creates a bucket.
 
Method Summary
 boolean computeTotal()
          Whether this bucket needs total calculation.
 BucketDefinition.Bucket create(java.lang.Object value)
          Creates a BucketValue object for a given value.
 java.util.Comparator getComparator()
          Returns the comparator used for bucket ordering.
 byte getTotalPosition()
          Returns the total bucket position.
 void setComputeTotal()
          Instructs that the bucket will need total bucket calculation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_ASCENDING

public static final byte ORDER_ASCENDING
Ascending order constant.

See Also:
Constant Field Values

ORDER_DESCENDING

public static final byte ORDER_DESCENDING
Descending order constant.

See Also:
Constant Field Values

TOTAL_POSITION_NONE

public static final byte TOTAL_POSITION_NONE
Constant indicating that total are not required for this bucket.

See Also:
Constant Field Values

TOTAL_POSITION_START

public static final byte TOTAL_POSITION_START
Constants indicating that totals are to be positioned before the other buckets.

See Also:
Constant Field Values

TOTAL_POSITION_END

public static final byte TOTAL_POSITION_END
Constants indicating that totals are to be positioned at the end of the other buckets.

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.


comparator

protected final java.util.Comparator comparator
Constructor Detail

BucketDefinition

public BucketDefinition(java.lang.Class valueClass,
                        java.util.Comparator comparator,
                        byte order,
                        byte totalPosition)
                 throws JRException
Creates a bucket.

Parameters:
valueClass - the class of the bucket values
comparator - the comparator to use for bucket sorting
order - the order type, ORDER_ASCENDING or ORDER_DESCENDING descending
totalPosition - the position of the total bucket
Throws:
JRException
Method Detail

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 byte getTotalPosition()
Returns the total bucket position.

Returns:
the total bucket position

getComparator

public java.util.Comparator getComparator()
Returns the comparator used for bucket ordering.

Returns:
the comparator used for bucket ordering

create

public BucketDefinition.Bucket create(java.lang.Object value)
Creates a BucketValue object for a given value.

Parameters:
value - the value
Returns:
the corresponding BucketValue object


© 2001-2006 JasperSoft Corporation www.jaspersoft.com