Package io.keikai.model
Interface SPivotField
- All Known Implementing Classes:
PivotFieldImpl
public interface SPivotField
Represents a field in a pivot table.
- Since:
- 7.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe axis on which this field is placed.static enumThe sort order for items in this field. -
Method Summary
Modifier and TypeMethodDescriptiongetAxis()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.default StringThe 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.default Set<SubtotalFunction>The named subtotal lines this row/column field shows, beyond the single automatic one thatisShowSubtotals()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).default booleanWhether this row/column field's groups are expanded.default 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.default voidsetNumberFormat(String format) Sets the number format of this field's item labels; null, blank orGeneralclears it.voidsetOutline(boolean outline) Sets outline display mode.default voidsetShowDetail(boolean show) Expands or collapses every group of this row/column field.default voidsetShowSubtotals(boolean show) Sets whether this row/column field shows subtotals for its groups.voidSets the sort type for items.default 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.
-
Method Details
-
getName
String getName()Returns the display name of this field.- Returns:
- the field name
-
getCacheFieldIndex
int getCacheFieldIndex()Returns the index into the pivot cache fields that this field references.- Returns:
- the cache field index
-
getAxis
SPivotField.Axis getAxis()Returns the axis this field is placed on.- Returns:
- the axis
-
setAxis
Sets the axis for this field.- Parameters:
axis- the axis
-
getSortType
SPivotField.SortType getSortType()Returns the sort type for items.- Returns:
- the sort type
-
setSortType
Sets the sort type for items.- Parameters:
sort- the sort type
-
isCompact
boolean isCompact()Returns whether this field uses compact display.- Returns:
- true if compact
-
setCompact
void setCompact(boolean compact) Sets compact display mode.- Parameters:
compact- true for compact
-
isOutline
boolean isOutline()Returns whether this field uses outline display.- Returns:
- true if outline
-
setOutline
void setOutline(boolean outline) Sets outline display mode.- Parameters:
outline- true for outline
-
isSubtotalTop
boolean isSubtotalTop()Returns whether subtotals are shown at the top.- Returns:
- true if subtotals at top
-
setSubtotalTop
void setSubtotalTop(boolean top) Sets whether subtotals are shown at the top.- Parameters:
top- true for subtotals at top
-
isShowAll
boolean isShowAll()Returns whether all items are shown (including those with no data).- Returns:
- true if showing all items
-
getItems
List<SPivotItem> getItems()Returns the items in this field.- Returns:
- list of pivot items
-
isItemHidden
boolean isItemHidden(int itemIndex) Returns whether the item at the given index is hidden.- Parameters:
itemIndex- zero-based item index- Returns:
- true if hidden
-
setItemHidden
void setItemHidden(int itemIndex, boolean hidden) Sets the hidden state for the item at the given index.- Parameters:
itemIndex- zero-based item indexhidden- true to hide
-
isShowSubtotals
default boolean isShowSubtotals()Whether this row/column field shows subtotals for its groups (thedefaultSubtotalattribute of ECMA-376 §18.10.1.69).- Since:
- 7.0.0
-
setShowSubtotals
default void setShowSubtotals(boolean show) Sets whether this row/column field shows subtotals for its groups.- Since:
- 7.0.0
-
getSubtotals
The named subtotal lines this row/column field shows, beyond the single automatic one thatisShowSubtotals()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.- Since:
- 7.0.0
-
setSubtotals
Sets the named subtotal lines this row/column field shows. Passing null or an empty set clears them, leaving onlysetShowSubtotals(boolean).- Since:
- 7.0.0
-
isShowDetail
default boolean isShowDetail()Whether 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.- Since:
- 7.0.0
-
setShowDetail
default void setShowDetail(boolean show) Expands or collapses every group of this row/column field.- Since:
- 7.0.0
-
getNumberFormat
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.- Since:
- 7.0.0
-
setNumberFormat
Sets the number format of this field's item labels; null, blank orGeneralclears it.- Since:
- 7.0.0
-