Class PivotFieldImpl

java.lang.Object
io.keikai.model.impl.PivotFieldImpl
All Implemented Interfaces:
SPivotField, Serializable

public class PivotFieldImpl extends Object implements SPivotField, Serializable
Default implementation of SPivotField.
Since:
7.0.0
See Also:
  • Constructor Details

    • PivotFieldImpl

      public PivotFieldImpl(String name, int cacheFieldIndex)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: SPivotField
      Returns the display name of this field.
      Specified by:
      getName in interface SPivotField
      Returns:
      the field name
    • getCacheFieldIndex

      public int getCacheFieldIndex()
      Description copied from interface: SPivotField
      Returns the index into the pivot cache fields that this field references.
      Specified by:
      getCacheFieldIndex in interface SPivotField
      Returns:
      the cache field index
    • getAxis

      public SPivotField.Axis getAxis()
      Description copied from interface: SPivotField
      Returns the axis this field is placed on.
      Specified by:
      getAxis in interface SPivotField
      Returns:
      the axis
    • setAxis

      public void setAxis(SPivotField.Axis axis)
      Description copied from interface: SPivotField
      Sets the axis for this field.
      Specified by:
      setAxis in interface SPivotField
      Parameters:
      axis - the axis
    • getSortType

      public SPivotField.SortType getSortType()
      Description copied from interface: SPivotField
      Returns the sort type for items.
      Specified by:
      getSortType in interface SPivotField
      Returns:
      the sort type
    • setSortType

      public void setSortType(SPivotField.SortType sort)
      Description copied from interface: SPivotField
      Sets the sort type for items.
      Specified by:
      setSortType in interface SPivotField
      Parameters:
      sort - the sort type
    • isCompact

      public boolean isCompact()
      Description copied from interface: SPivotField
      Returns whether this field uses compact display.
      Specified by:
      isCompact in interface SPivotField
      Returns:
      true if compact
    • setCompact

      public void setCompact(boolean compact)
      Description copied from interface: SPivotField
      Sets compact display mode.
      Specified by:
      setCompact in interface SPivotField
      Parameters:
      compact - true for compact
    • isOutline

      public boolean isOutline()
      Description copied from interface: SPivotField
      Returns whether this field uses outline display.
      Specified by:
      isOutline in interface SPivotField
      Returns:
      true if outline
    • setOutline

      public void setOutline(boolean outline)
      Description copied from interface: SPivotField
      Sets outline display mode.
      Specified by:
      setOutline in interface SPivotField
      Parameters:
      outline - true for outline
    • isSubtotalTop

      public boolean isSubtotalTop()
      Description copied from interface: SPivotField
      Returns whether subtotals are shown at the top.
      Specified by:
      isSubtotalTop in interface SPivotField
      Returns:
      true if subtotals at top
    • setSubtotalTop

      public void setSubtotalTop(boolean top)
      Description copied from interface: SPivotField
      Sets whether subtotals are shown at the top.
      Specified by:
      setSubtotalTop in interface SPivotField
      Parameters:
      top - true for subtotals at top
    • isShowAll

      public boolean isShowAll()
      Description copied from interface: SPivotField
      Returns whether all items are shown (including those with no data).
      Specified by:
      isShowAll in interface SPivotField
      Returns:
      true if showing all items
    • setShowAll

      public void setShowAll(boolean showAll)
    • getItems

      public List<SPivotItem> getItems()
      Description copied from interface: SPivotField
      Returns the items in this field.
      Specified by:
      getItems in interface SPivotField
      Returns:
      list of pivot items
    • addItem

      public void addItem(SPivotItem item)
      Adds an item to this field.
      Parameters:
      item - the item to add
    • isItemHidden

      public boolean isItemHidden(int itemIndex)
      Description copied from interface: SPivotField
      Returns whether the item at the given index is hidden.
      Specified by:
      isItemHidden in interface SPivotField
      Parameters:
      itemIndex - zero-based item index
      Returns:
      true if hidden
    • setItemHidden

      public void setItemHidden(int itemIndex, boolean hidden)
      Description copied from interface: SPivotField
      Sets the hidden state for the item at the given index.
      Specified by:
      setItemHidden in interface SPivotField
      Parameters:
      itemIndex - zero-based item index
      hidden - true to hide
    • isShowSubtotals

      public boolean isShowSubtotals()
      Description copied from interface: SPivotField
      Whether this row/column field shows subtotals for its groups (the defaultSubtotal attribute of ECMA-376 §18.10.1.69).
      Specified by:
      isShowSubtotals in interface SPivotField
    • setShowSubtotals

      public void setShowSubtotals(boolean show)
      Description copied from interface: SPivotField
      Sets whether this row/column field shows subtotals for its groups.
      Specified by:
      setShowSubtotals in interface SPivotField
    • getSubtotals

      public Set<SubtotalFunction> getSubtotals()
      Description copied from interface: SPivotField
      The named subtotal lines this row/column field shows, beyond the single automatic one that SPivotField.isShowSubtotals() toggles — the sumSubtotal / avgSubtotal / … attributes of ECMA-376 §18.10.1.69. Excel renders one subtotal row per function per group, so a field can show a Sum and an Average subtotal side by side. An empty set is the ordinary case: one subtotal using the field's own aggregate.
      Specified by:
      getSubtotals in interface SPivotField
    • setSubtotals

      public void setSubtotals(Set<SubtotalFunction> functions)
      Description copied from interface: SPivotField
      Sets the named subtotal lines this row/column field shows. Passing null or an empty set clears them, leaving only SPivotField.setShowSubtotals(boolean).
      Specified by:
      setSubtotals in interface SPivotField
    • isShowDetail

      public boolean isShowDetail()
      Description copied from interface: SPivotField
      Whether this row/column field's groups are expanded. A collapsed field writes sd="0" on each of its items (ECMA-376 §18.10.1.45), which is how Excel stores a group closed with its "-" button.
      Specified by:
      isShowDetail in interface SPivotField
    • setShowDetail

      public void setShowDetail(boolean show)
      Description copied from interface: SPivotField
      Expands or collapses every group of this row/column field.
      Specified by:
      setShowDetail in interface SPivotField
    • getNumberFormat

      public String getNumberFormat()
      Description copied from interface: SPivotField
      The number format of this row/column/page field's item labels, as an Excel format code — pivotField/@numFmtId (ECMA-376 §18.10.1.69). A field of dates keeps its date format through it when the pivot is refreshed. Null when the field has none.
      Specified by:
      getNumberFormat in interface SPivotField
    • setNumberFormat

      public void setNumberFormat(String format)
      Description copied from interface: SPivotField
      Sets the number format of this field's item labels; null, blank or General clears it.
      Specified by:
      setNumberFormat in interface SPivotField