net.sf.jasperreports.crosstabs.base

## Class JRBaseCrosstabGroup

- java.lang.Object
- - net.sf.jasperreports.crosstabs.base.JRBaseCrosstabGroup

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, CrosstabBaseCloneable, JRCrosstabGroup, JRCloneable
  Direct Known Subclasses:
    JRBaseCrosstabColumnGroup, JRBaseCrosstabRowGroup, JRDesignCrosstabGroup

      public abstract class JRBaseCrosstabGroup
      extends java.lang.Object
      implements JRCrosstabGroup, java.io.Serializable, CrosstabBaseCloneable

  Base read-only implementation for crosstab row and column groups.
  Version:
    $Id: JRBaseCrosstabGroup.java 6255 2013-06-12 12:40:27Z lucianc $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected JRCrosstabBucket` | `bucket`
    `protected JRCellContents` | `header`
    `protected java.lang.String` | `name`
    `protected JRCellContents` | `totalHeader`
    `protected CrosstabTotalPositionEnum` | `totalPositionValue`
    `protected JRVariable` | `variable`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRBaseCrosstabGroup()`
    `` | `JRBaseCrosstabGroup(JRCrosstabGroup group, JRBaseObjectFactory factory)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `clone()`
    `JRCrosstabGroup` | `clone(CrosstabBaseCloneFactory cloneFactory)`
    `JRCrosstabBucket` | `getBucket()` Returns the bucketing information for this group.
    `JRCellContents` | `getHeader()` Returns the group header cell.
    `java.lang.String` | `getName()` Returns the name of the group.
    `JRCellContents` | `getTotalHeader()` Returns the group total header cell.
    `CrosstabTotalPositionEnum` | `getTotalPositionValue()` Returns the position of the total row/column for this group.
    `JRVariable` | `getVariable()` Returns the variable associated to this group.
    `boolean` | `hasTotal()` Returns whether the group has a total row/column.

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### name

          protected java.lang.String name

    - #### totalPositionValue

          protected CrosstabTotalPositionEnum totalPositionValue

    - #### bucket

          protected JRCrosstabBucket bucket

    - #### header

          protected JRCellContents header

    - #### totalHeader

          protected JRCellContents totalHeader

    - #### variable

          protected JRVariable variable

  - ### Constructor Detail

    - #### JRBaseCrosstabGroup

          protected JRBaseCrosstabGroup()

    - #### JRBaseCrosstabGroup

          public JRBaseCrosstabGroup(JRCrosstabGroup group,
                             JRBaseObjectFactory factory)

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `JRCrosstabGroup`
      Returns the name of the group.
      Specified by:
        `getName` in interface `JRCrosstabGroup`
      Returns:
        the name of the group
      See Also:
        `JRCrosstabGroup.getVariable()`

    - #### getBucket

          public JRCrosstabBucket getBucket()

      Description copied from interface: `JRCrosstabGroup`
      Returns the bucketing information for this group.

      The bucketing information consists of grouping expression and group ordering.

      Specified by:
        `getBucket` in interface `JRCrosstabGroup`
      Returns:
        the bucketing information for this group

    - #### getTotalPositionValue

          public CrosstabTotalPositionEnum getTotalPositionValue()

      Description copied from interface: `JRCrosstabGroup`
      Returns the position of the total row/column for this group.

      A group can have a total row/column summing the values for all the entries in the group. E.g. if there is a Year group having Month as a subgroup, the total row/column for the Year group would sum the values for all the years and the total row/column for the Month group would sum the values for all the months of an year.

      Possible values for this attribute are:

      - `CrosstabTotalPositionEnum.NONE` - the group will not display a total row/column
      - `CrosstabTotalPositionEnum.START` - the group will display the total row/column before the group rows/columns
      - `CrosstabTotalPositionEnum.END` - the group will display the total row/column at the end of the group rows/columns
      Specified by:
        `getTotalPositionValue` in interface `JRCrosstabGroup`
      Returns:
        the position of the total row/column for this group

    - #### hasTotal

          public boolean hasTotal()

      Description copied from interface: `JRCrosstabGroup`
      Returns whether the group has a total row/column.

      This method is currently equivalent to `getTotalPosition() != Bucket.TOTAL_POSITION_NONE` and is therefore redundant.

      Specified by:
        `hasTotal` in interface `JRCrosstabGroup`
      Returns:
        whether the group has a total row/column

    - #### getHeader

          public JRCellContents getHeader()

      Description copied from interface: `JRCrosstabGroup`
      Returns the group header cell.

      The size of the header cell is computed based on the following rules (only the row header rules are listed, the ones for columns can be deducted by symmetrical duality):

      - the width of the header is given by `JRCrosstabRowGroup.getWidth()`
      - the height of the last row group header is given by the height of the base cell
      - the height of a non-last row group header is the sum of the next group header's height and the next group total header's height (0 if the next group doesn't have a total header)

      Should never return null, but empty cell contents instead.

      Specified by:
        `getHeader` in interface `JRCrosstabGroup`
      Returns:
        the group header cell

    - #### getTotalHeader

          public JRCellContents getTotalHeader()

      Description copied from interface: `JRCrosstabGroup`
      Returns the group total header cell.

      The size of a row group total header is computed based on the following rules:

      - the width is the sum the widths of this and subsequent row groups
      - the height is the height of the base cell for this total row

      Should never return null, but empty cell contents instead.

      Specified by:
        `getTotalHeader` in interface `JRCrosstabGroup`
      Returns:
        the group total header cell

    - #### getVariable

          public JRVariable getVariable()

      Description copied from interface: `JRCrosstabGroup`
      Returns the variable associated to this group.

      Each group in the crosstab has a variable that can be used inside the group header as the current group value. The variable has the same name as the group and the same type as the bucket expression of the group.

      Specified by:
        `getVariable` in interface `JRCrosstabGroup`
      Returns:
        the variable associated to this group

    - #### clone

          public java.lang.Object clone()

      Specified by:
        `clone` in interface `JRCloneable`
      Overrides:
        `clone` in class `java.lang.Object`

    - #### clone

          public JRCrosstabGroup clone(CrosstabBaseCloneFactory cloneFactory)

      Specified by:
        `clone` in interface `CrosstabBaseCloneable`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com