Package io.keikai.model.impl
Class PivotFieldImpl
java.lang.Object
io.keikai.model.impl.PivotFieldImpl
- All Implemented Interfaces:
SPivotField,Serializable
Default implementation of
SPivotField.- Since:
- 7.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.keikai.model.SPivotField
SPivotField.Axis, SPivotField.SortType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItem(SPivotItem item) Adds an item to this field.getAxis()Returns the axis this field is placed on.intReturns the index into the pivot cache fields that this field references.getItems()Returns the items in this field.getName()Returns the display name of this field.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).Returns the sort type for items.The named subtotal lines this row/column field shows, beyond the single automatic one thatSPivotField.isShowSubtotals()toggles — thesumSubtotal/avgSubtotal/ … attributes of ECMA-376 §18.10.1.69.booleanReturns whether this field uses compact display.booleanisItemHidden(int itemIndex) Returns whether the item at the given index is hidden.booleanReturns whether this field uses outline display.booleanReturns whether all items are shown (including those with no data).booleanWhether this row/column field's groups are expanded.booleanWhether this row/column field shows subtotals for its groups (thedefaultSubtotalattribute of ECMA-376 §18.10.1.69).booleanReturns whether subtotals are shown at the top.voidsetAxis(SPivotField.Axis axis) Sets the axis for this field.voidsetCompact(boolean compact) Sets compact display mode.voidsetItemHidden(int itemIndex, boolean hidden) Sets the hidden state for the item at the given index.voidsetNumberFormat(String format) Sets the number format of this field's item labels; null, blank orGeneralclears it.voidsetOutline(boolean outline) Sets outline display mode.voidsetShowAll(boolean showAll) voidsetShowDetail(boolean show) Expands or collapses every group of this row/column field.voidsetShowSubtotals(boolean show) Sets whether this row/column field shows subtotals for its groups.voidSets the sort type for items.voidsetSubtotals(Set<SubtotalFunction> functions) Sets the named subtotal lines this row/column field shows.voidsetSubtotalTop(boolean top) Sets whether subtotals are shown at the top.
-
Constructor Details
-
PivotFieldImpl
-
-
Method Details
-
getName
Description copied from interface:SPivotFieldReturns the display name of this field.- Specified by:
getNamein interfaceSPivotField- Returns:
- the field name
-
getCacheFieldIndex
public int getCacheFieldIndex()Description copied from interface:SPivotFieldReturns the index into the pivot cache fields that this field references.- Specified by:
getCacheFieldIndexin interfaceSPivotField- Returns:
- the cache field index
-
getAxis
Description copied from interface:SPivotFieldReturns the axis this field is placed on.- Specified by:
getAxisin interfaceSPivotField- Returns:
- the axis
-
setAxis
Description copied from interface:SPivotFieldSets the axis for this field.- Specified by:
setAxisin interfaceSPivotField- Parameters:
axis- the axis
-
getSortType
Description copied from interface:SPivotFieldReturns the sort type for items.- Specified by:
getSortTypein interfaceSPivotField- Returns:
- the sort type
-
setSortType
Description copied from interface:SPivotFieldSets the sort type for items.- Specified by:
setSortTypein interfaceSPivotField- Parameters:
sort- the sort type
-
isCompact
public boolean isCompact()Description copied from interface:SPivotFieldReturns whether this field uses compact display.- Specified by:
isCompactin interfaceSPivotField- Returns:
- true if compact
-
setCompact
public void setCompact(boolean compact) Description copied from interface:SPivotFieldSets compact display mode.- Specified by:
setCompactin interfaceSPivotField- Parameters:
compact- true for compact
-
isOutline
public boolean isOutline()Description copied from interface:SPivotFieldReturns whether this field uses outline display.- Specified by:
isOutlinein interfaceSPivotField- Returns:
- true if outline
-
setOutline
public void setOutline(boolean outline) Description copied from interface:SPivotFieldSets outline display mode.- Specified by:
setOutlinein interfaceSPivotField- Parameters:
outline- true for outline
-
isSubtotalTop
public boolean isSubtotalTop()Description copied from interface:SPivotFieldReturns whether subtotals are shown at the top.- Specified by:
isSubtotalTopin interfaceSPivotField- Returns:
- true if subtotals at top
-
setSubtotalTop
public void setSubtotalTop(boolean top) Description copied from interface:SPivotFieldSets whether subtotals are shown at the top.- Specified by:
setSubtotalTopin interfaceSPivotField- Parameters:
top- true for subtotals at top
-
isShowAll
public boolean isShowAll()Description copied from interface:SPivotFieldReturns whether all items are shown (including those with no data).- Specified by:
isShowAllin interfaceSPivotField- Returns:
- true if showing all items
-
setShowAll
public void setShowAll(boolean showAll) -
getItems
Description copied from interface:SPivotFieldReturns the items in this field.- Specified by:
getItemsin interfaceSPivotField- Returns:
- list of pivot items
-
addItem
Adds an item to this field.- Parameters:
item- the item to add
-
isItemHidden
public boolean isItemHidden(int itemIndex) Description copied from interface:SPivotFieldReturns whether the item at the given index is hidden.- Specified by:
isItemHiddenin interfaceSPivotField- Parameters:
itemIndex- zero-based item index- Returns:
- true if hidden
-
setItemHidden
public void setItemHidden(int itemIndex, boolean hidden) Description copied from interface:SPivotFieldSets the hidden state for the item at the given index.- Specified by:
setItemHiddenin interfaceSPivotField- Parameters:
itemIndex- zero-based item indexhidden- true to hide
-
isShowSubtotals
public boolean isShowSubtotals()Description copied from interface:SPivotFieldWhether this row/column field shows subtotals for its groups (thedefaultSubtotalattribute of ECMA-376 §18.10.1.69).- Specified by:
isShowSubtotalsin interfaceSPivotField
-
setShowSubtotals
public void setShowSubtotals(boolean show) Description copied from interface:SPivotFieldSets whether this row/column field shows subtotals for its groups.- Specified by:
setShowSubtotalsin interfaceSPivotField
-
getSubtotals
Description copied from interface:SPivotFieldThe named subtotal lines this row/column field shows, beyond the single automatic one thatSPivotField.isShowSubtotals()toggles — thesumSubtotal/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:
getSubtotalsin interfaceSPivotField
-
setSubtotals
Description copied from interface:SPivotFieldSets the named subtotal lines this row/column field shows. Passing null or an empty set clears them, leaving onlySPivotField.setShowSubtotals(boolean).- Specified by:
setSubtotalsin interfaceSPivotField
-
isShowDetail
public boolean isShowDetail()Description copied from interface:SPivotFieldWhether this row/column field's groups are expanded. A collapsed field writessd="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:
isShowDetailin interfaceSPivotField
-
setShowDetail
public void setShowDetail(boolean show) Description copied from interface:SPivotFieldExpands or collapses every group of this row/column field.- Specified by:
setShowDetailin interfaceSPivotField
-
getNumberFormat
Description copied from interface:SPivotFieldThe 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:
getNumberFormatin interfaceSPivotField
-
setNumberFormat
Description copied from interface:SPivotFieldSets the number format of this field's item labels; null, blank orGeneralclears it.- Specified by:
setNumberFormatin interfaceSPivotField
-