com.f1j.ss.datarange
Interface Range


public interface Range
extends Lockable

This interface defines a range for a DataRange. You can use this class to act upon areas within a DataRange, and to act upon the intersections of row and column sections of a DataRange.

Since:
12.0

Method Summary
 void clearBorderFormat()
          Clears any section border formats associated with this Range object's selection.
 CellFormat getBorderFormat(boolean createTemplate)
          Returns a CellFormat object containing the borders associated with this Range object's selection.
 SectionSet getColSet()
          Returns a SectionSet object representing the columns of this Range.
 SectionSet getRowSet()
          Returns a SectionSet object representing the row sections of this range.
 boolean isMergeCells()
          Indicates whether cells at the intersection specified by this Range object are merged when the report is run.
 void setBorderFormat(CellFormat format)
          Sets borders for the sections represented by this range.
 void setCommands(java.lang.String commands)
          Sets the Report Function commands for the cell represented by this range.
 void setExtent(Section section)
          Extends the selection for this range to include the specified section.
 void setMergeCells(boolean merged)
          Specifies whether to merge cells at the intersection specified by this Range, when the report is run.
 void setSection(Section section, boolean selectCells)
          Selects the specified section for this range.
 
Methods inherited from interface com.f1j.util.Lockable
getLock, releaseLock
 

Method Detail

getColSet

public SectionSet getColSet()
Returns a SectionSet object representing the columns of this Range.
Returns:
a SectionSet object representing the columns of this Range.
Since:
12.0
See Also:
setSection(com.f1j.ss.datarange.Section, boolean), setExtent(com.f1j.ss.datarange.Section), getRowSet()

getRowSet

public SectionSet getRowSet()
Returns a SectionSet object representing the row sections of this range.
Returns:
a SectionSet object representing the row sections of this range.
Since:
12.0
See Also:
setSection(com.f1j.ss.datarange.Section, boolean), setExtent(com.f1j.ss.datarange.Section), getColSet()

setCommands

public void setCommands(java.lang.String commands)
                 throws AccessDeniedException,
                        DataConflictException,
                        InvalidArgumentException,
                        SelectionException
Sets the Report Function commands for the cell represented by this range.
Parameters:
commands - the Report Functions to be set into this range.
Throws:
AccessDeniedException - if the cell is protected.
DataConflictException - if the Report Functions would conflict with existing data in the workbook.
InvalidArgumentException - if the commands are invalid.
SelectionException - if the range contains more than one cell.
Since:
12.0

setExtent

public void setExtent(Section section)
Extends the selection for this range to include the specified section. The section may be on either axis, and will only affect the selection on that axis. This method is used in conjunction with the setSection(com.f1j.ss.datarange.Section, boolean) method to select a range of sections.
Parameters:
section - The section to which this Range object's selection will be extended.
Since:
12.0
See Also:
setSection(com.f1j.ss.datarange.Section, boolean), getRowSet(), getColSet(), SectionSet.getExtent()

setSection

public void setSection(Section section,
                       boolean selectCells)
Selects the specified section for this range. The section may be on either axis, and will become the only section on that axis that is selected for this range.
Parameters:
section - The section to select.
selectCells - If true, the complete set of cells associated with section are always selected, even if the prior cell selection was consistent with the new section selection. If false, the cell selection will only be changed if necessary for consistency.
Since:
12.0
See Also:
setExtent(com.f1j.ss.datarange.Section), getRowSet(), getColSet(), SectionSet.getBase()

clearBorderFormat

public void clearBorderFormat()
                       throws SelectionException
Clears any section border formats associated with this Range object's selection.
Throws:
SelectionException - if this Range object's selection does not consist of a single row section and a single column section.
Since:
12.0
See Also:
getBorderFormat(boolean), setBorderFormat(com.f1j.ss.CellFormat)

getBorderFormat

public CellFormat getBorderFormat(boolean createTemplate)
                           throws SelectionException
Returns a CellFormat object containing the borders associated with this Range object's selection. If no borders have been defined, then the return value is determined by the createTemplate argument.
Parameters:
createTemplate - Specifies whether to create and return an empty CellFormat if no borders have been defined.
Returns:
A CellFormat object representing the borders, or null.
Throws:
SelectionException - if this Range object's selection does not consist of a single row section and a single column section.
Since:
12.0
See Also:
setBorderFormat(com.f1j.ss.CellFormat), clearBorderFormat()

isMergeCells

public boolean isMergeCells()
                     throws SelectionException
Indicates whether cells at the intersection specified by this Range object are merged when the report is run.
Returns:
true if cells are merged.
Throws:
SelectionException - if this Range object's selection does not consist of a single row section and a single column section.
Since:
12.0
See Also:
setMergeCells(boolean)

setBorderFormat

public void setBorderFormat(CellFormat format)
                     throws SelectionException,
                            RuleConflictException
Sets borders for the sections represented by this range.
Parameters:
format - Specifies the border format. Other formatting attributes contained in this object are ignored.
Throws:
SelectionException - if this Range object's selection does not consist of a single row section and a single column section.
RuleConflictException - if this operation would conflict with existing formatting. This exception is declared for future use.
Since:
12.0
See Also:
getBorderFormat(boolean), clearBorderFormat()

setMergeCells

public void setMergeCells(boolean merged)
                   throws SelectionException,
                          RuleConflictException
Specifies whether to merge cells at the intersection specified by this Range, when the report is run.
Parameters:
merged - true to merge cells.
Throws:
SelectionException - if this Range object's selection does not consist of a single row section and a single column section.
RuleConflictException - if this operation would result in overlapping merged cells.
Since:
12.0
See Also:
isMergeCells()