com.f1j.ss.pivot
Interface Range


public interface Range

This interface defines a range for a PivotRange. You can use this class to act upon areas within a PivotRange.


Inner Class Summary
static class Range.EMoveType
          Enumeration class for defining types of moves.
 
Method Summary
 boolean canMove(Range.EMoveType move, Field field)
          If this range contains a field title, indicates if the field can be moved as specified.
 boolean canShowHideDetail(int row, int col)
          Indicates if the cell can show or hide detail.
 boolean containsBlankLine()
          Indicates whether this range includes a blank line.
 boolean containsDataLine()
          Indicates whether this range includes any line of data, including subtotals, grand totals, and blank lines.
 boolean containsFieldTitle()
          Indicates whether this range includes a field title.
 boolean containsGrandTotal()
          Indicates whether this range includes a grand total.
 boolean containsSubtotal()
          Indicates whether this range includes a subtotal.
 Field getField()
          Returns the field associated with this range.
 Item[] getItems(Field field)
          Returns the items within this range for the specified field.
 void group(Field field)
          Group the items within this range for the specified field.
 void hide()
          Hides PivotRange elements within this range.
 void hideDetail(Field field)
          Hides detail for the items within this range for the specified field.
 boolean isPivotDataSelection()
          Indicates that this range includes data from the Data area.
 boolean isPivotLabelSelection()
          Indicates that this range includes a data label from the Row, Column, or Page area.
 boolean isPivotSelection()
          Returns true if the range is is a PivotRange selection.
 void move(Range.EMoveType move, Field field)
          If this range contains a field title, then moves the field.
 void setPivotSelectionType(boolean labels, boolean data)
          Sets the PivotRange selection type for this range.
 void showDetail(Field field)
          Shows detail for the items of the specified field within this range.
 Sheet showDetail(int activeRow, int activeCol)
          Shows detail for the items at the specified cell within this range.
 void showInnerDetail(Field field, Field detailField)
          Uses detailField to show detail for the items within this range for the specified field.
 void ungroup(Field field)
          Ungroups the selected items within this range for the specified field.
 

Method Detail

canMove

public boolean canMove(Range.EMoveType move,
                       Field field)
                throws InvalidPivotRangeException,
                       F1Exception
If this range contains a field title, indicates if the field can be moved as specified. If this range contains an item, indicates if this item can be moved as specified.
Parameters:
move - Indicates how to move the field/item.
field - The field to move.
Throws:
InvalidPivotRangeException - if the pivot range is invalid.
F1Exception - if an error occurs.
Since:
11.0
See Also:
move(com.f1j.ss.pivot.Range.EMoveType, com.f1j.ss.pivot.Field), Field, Item

canShowHideDetail

public boolean canShowHideDetail(int row,
                                 int col)
Indicates if the cell can show or hide detail.
Parameters:
row - The row.
col - The col.
Since:
11.0

containsBlankLine

public boolean containsBlankLine()
Indicates whether this range includes a blank line.
Returns:
boolean. true = if range contains a blank line.
Since:
11.0
See Also:
Field

containsDataLine

public boolean containsDataLine()
Indicates whether this range includes any line of data, including subtotals, grand totals, and blank lines.
Returns:
boolean. true = if range contains a data line.
Since:
11.0
See Also:
Field

containsFieldTitle

public boolean containsFieldTitle()
Indicates whether this range includes a field title.
Returns:
boolean. true = if range contains field's title.
Since:
11.0
See Also:
Field

containsGrandTotal

public boolean containsGrandTotal()
Indicates whether this range includes a grand total.
Returns:
boolean. true = if range contains a grand total.
Since:
11.0
See Also:
Field

containsSubtotal

public boolean containsSubtotal()
Indicates whether this range includes a subtotal.
Returns:
boolean. true = if range contains a subtotal.
Since:
11.0
See Also:
Field

getField

public Field getField()
               throws SelectionException,
                      F1Exception
Returns the field associated with this range. Only valid if there is a single field within this range.
Returns:
The field within this range.
Throws:
SelectionException - if more than one field in range.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

getItems

public Item[] getItems(Field field)
                throws SelectionException,
                       F1Exception
Returns the items within this range for the specified field.
Parameters:
field - The field from which the items should be retrieved.
Returns:
An array of the selected items.
Throws:
SelectionException - if the specified field is not in this range.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

group

public void group(Field field)
           throws InvalidPivotRangeException,
                  SelectionException,
                  F1Exception
Group the items within this range for the specified field. The range must include at least 2 items within the field.
Parameters:
field - The field to be grouped.
Throws:
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if specified field cannot be grouped.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

hide

public void hide()
          throws AccessDeniedException,
                 InvalidPivotRangeException,
                 SelectionException,
                 F1Exception
Hides PivotRange elements within this range.
Throws:
AccessDeniedException - if sheet is protected.
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if cannot hide elements within this range.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

hideDetail

public void hideDetail(Field field)
                throws InvalidPivotRangeException,
                       SelectionException,
                       F1Exception
Hides detail for the items within this range for the specified field.
Parameters:
field - The field for which detail should be hidden.
Throws:
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if detail cannot be hidden for the specified field.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

isPivotDataSelection

public boolean isPivotDataSelection()
Indicates that this range includes data from the Data area.
Since:
11.0
See Also:
setPivotSelectionType(boolean, boolean)

isPivotLabelSelection

public boolean isPivotLabelSelection()
Indicates that this range includes a data label from the Row, Column, or Page area.
Since:
11.0
See Also:
setPivotSelectionType(boolean, boolean)

isPivotSelection

public boolean isPivotSelection()
Returns true if the range is is a PivotRange selection.
Since:
11.0

move

public void move(Range.EMoveType move,
                 Field field)
          throws AccessDeniedException,
                 DataConflictException,
                 InvalidPivotRangeException,
                 SelectionException,
                 F1Exception
If this range contains a field title, then moves the field. If this range contains an item, then moves the item.
Parameters:
move - Indicates how to move the field/item.
field - The field to move.
Throws:
AccessDeniedException - if sheet is protected.
DataConflictException - if the PivotRange would become too large.
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if the specified field cannot be moved.
F1Exception - if an error occurs.
Since:
11.0
See Also:
canMove(com.f1j.ss.pivot.Range.EMoveType, com.f1j.ss.pivot.Field), Field, Item

setPivotSelectionType

public void setPivotSelectionType(boolean labels,
                                  boolean data)
                           throws SelectionException
Sets the PivotRange selection type for this range.
Parameters:
labels - Specifies whether data labels in the Row, Column, or Page areas are selected.
data - Specifies whether data in the the Data area is selected.
Throws:
SelectionException - if the specified selection type is not valid for this range.
Since:
11.0
See Also:
isPivotDataSelection(), isPivotLabelSelection()

showDetail

public void showDetail(Field field)
                throws InvalidPivotRangeException,
                       SelectionException,
                       F1Exception
Shows detail for the items of the specified field within this range.
Parameters:
field - The field for which detail should be shown.
Throws:
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if detail cannot be shown for the specified field.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

showDetail

public Sheet showDetail(int activeRow,
                        int activeCol)
                 throws InvalidPivotRangeException,
                        SelectionException,
                        F1Exception
Shows detail for the items at the specified cell within this range.
Parameters:
activeRow - The active row.
activeCol - The active column.
Returns:
The sheet the detail is displayed on.
Throws:
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if detail cannot be shown for the specified cell.
F1Exception - if an error occurs during this operation.
Since:
11.0
See Also:
Field

showInnerDetail

public void showInnerDetail(Field field,
                            Field detailField)
                     throws AccessDeniedException,
                            DataConflictException,
                            InvalidPivotRangeException,
                            SelectionException,
                            F1Exception
Uses detailField to show detail for the items within this range for the specified field.
Parameters:
field - The field for which detail should be shown.
detailField - The field to use as the detail.
Throws:
AccessDeniedException - if sheet is protected.
DataConflictException - if the PivotRange would become too large.
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if detail cannot be shown for the specified fields.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

ungroup

public void ungroup(Field field)
             throws InvalidPivotRangeException,
                    SelectionException,
                    F1Exception
Ungroups the selected items within this range for the specified field.
Parameters:
field - The field to ungroup.
Throws:
InvalidPivotRangeException - if the pivot range is invalid.
SelectionException - if specified field cannot be ungrouped.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field