org.apache.poi.ss.util
Class CellRangeAddress

java.lang.Object
  extended by org.apache.poi.ss.util.CellRangeAddressBase
      extended by org.apache.poi.ss.util.CellRangeAddress
Direct Known Subclasses:
CellRangeAddress

public class CellRangeAddress
extends CellRangeAddressBase

See OOO documentation: excelfileformat.pdf sec 2.5.14 - 'Cell Range Address'

In the Microsoft documentation, this is also known as a Ref8U - see page 831 of version 1.0 of the documentation. Note - SelectionRecord uses the BIFF5 version of this structure

Author:
Dragos Buleandra (dragos.buleandra@trade2b.ro)

Field Summary
static int ENCODED_SIZE
           
 
Constructor Summary
CellRangeAddress(int firstRow, int lastRow, int firstCol, int lastCol)
           
CellRangeAddress(RecordInputStream in)
           
 
Method Summary
 CellRangeAddress copy()
           
 java.lang.String formatAsString()
           
 java.lang.String formatAsString(java.lang.String sheetName, boolean useAbsoluteAddress)
           
static int getEncodedSize(int numberOfItems)
           
 int serialize(int offset, byte[] data)
          Deprecated. use serialize(LittleEndianOutput)
 void serialize(LittleEndianOutput out)
           
static CellRangeAddress valueOf(java.lang.String ref)
           
 
Methods inherited from class org.apache.poi.ss.util.CellRangeAddressBase
getFirstColumn, getFirstRow, getLastColumn, getLastRow, getNumberOfCells, isFullColumnRange, isFullRowRange, isInRange, setFirstColumn, setFirstRow, setLastColumn, setLastRow, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENCODED_SIZE

public static final int ENCODED_SIZE
See Also:
Constant Field Values
Constructor Detail

CellRangeAddress

public CellRangeAddress(int firstRow,
                        int lastRow,
                        int firstCol,
                        int lastCol)

CellRangeAddress

public CellRangeAddress(RecordInputStream in)
Method Detail

serialize

public int serialize(int offset,
                     byte[] data)
Deprecated. use serialize(LittleEndianOutput)


serialize

public void serialize(LittleEndianOutput out)

copy

public CellRangeAddress copy()

getEncodedSize

public static int getEncodedSize(int numberOfItems)

formatAsString

public java.lang.String formatAsString()
Returns:
the text format of this range. Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1').

formatAsString

public java.lang.String formatAsString(java.lang.String sheetName,
                                       boolean useAbsoluteAddress)
Returns:
the text format of this range using specified sheet name.

valueOf

public static CellRangeAddress valueOf(java.lang.String ref)
Parameters:
ref - usually a standard area ref (e.g. "B1:D8"). May be a single cell ref (e.g. "B5") in which case the result is a 1 x 1 cell range.


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.