Top Description Fields Constructors Methods
org.apache.poi.ss.formula.ptg

public abstract Class AreaPtgBase

extends OperandPtg
implements AreaI
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.ptg.AreaI
Known Direct Subclasses
org.apache.poi.ss.formula.ptg.Area2DPtgBase, org.apache.poi.ss.formula.ptg.Area3DPtg, org.apache.poi.ss.formula.ptg.Area3DPxg
Imports
java.util.Map, java.util.function.Supplier, org.apache.poi.ss.SpreadsheetVersion, org.apache.poi.ss.util.AreaReference, .CellReference, org.apache.poi.util.BitField, .BitFieldFactory, .GenericRecordUtil, .LittleEndianInput, .LittleEndianOutput

Specifies a rectangular area of cells A1:A4 for instance.

Field Summary

Modifier and TypeField and Description
private static final BitField
private static final BitField
private int
field_1_first_row

zero based, unsigned 16 bit

private int
field_2_last_row

zero based, unsigned 16 bit

private int
field_3_first_column

zero based, unsigned 8 bit

private int
field_4_last_column

zero based, unsigned 8 bit

private static final BitField

Constructor Summary

AccessConstructor and Description
protected
protected
protected
protected
AreaPtgBase(int firstRow, int lastRow, int firstColumn, int lastColumn, boolean firstRowRelative, boolean lastRowRelative, boolean firstColRelative, boolean lastColRelative)

Method Summary

Modifier and TypeMethod and Description
protected final String
public byte
public final int

Returns:

the first column number in the area.
getFirstColumn
()

Implements org.apache.poi.ss.formula.ptg.AreaI.getFirstColumn.

public final short

Returns:

the first column number + the options bit settings unstripped
getFirstColumnRaw
()

public final int

Returns:

the first row in the area
getFirstRow
()

Implements org.apache.poi.ss.formula.ptg.AreaI.getFirstRow.

public Map<String, Supplier<?>>
public final int

Returns:

lastcolumn in the area
getLastColumn
()

Implements org.apache.poi.ss.formula.ptg.AreaI.getLastColumn.

public final short

Returns:

last column and bitmask (the raw field)
getLastColumnRaw
()

public final int

Returns:

last row in the range (x2 in x1,y1-x2,y2)
getLastRow
()

Implements org.apache.poi.ss.formula.ptg.AreaI.getLastRow.

public final boolean

Returns:

isrelative first column to relative or not
isFirstColRelative
()

public final boolean

Returns:

whether or not the first row is a relative reference or not.
isFirstRowRelative
()

public final boolean

Returns:

lastcol relative or not
isLastColRelative
()

public final boolean

Returns:

last row relative or not
isLastRowRelative
()

protected final void
public final void
setFirstColRelative(boolean rel)

set whether the first column is relative

public final void
setFirstColumn(int colIx)

set the first column in the area

public final void
setFirstColumnRaw(int column)

set the first column irrespective of the bitmasks

public final void
setFirstRow(int
number (0-based)
rowIx
)

sets the first row

public final void
setFirstRowRelative(boolean
is relative or not.
rel
)

sets the first row to relative or not

public final void
setLastColRelative(boolean rel)

set whether the last column should be relative or not

public final void
setLastColumn(int colIx)

set the last column in the area

public final void
setLastColumnRaw(short column)

set the last column irrespective of the bitmasks

public final void
setLastRow(int
last row number in the area
rowIx
)

public final void
setLastRowRelative(boolean
true if the last row relative, else false
rel
)

set whether the last row is relative or not

public void
sortTopLeftToBottomRight()

Sort the first and last row and columns in-place to the preferred (top left:bottom right) order

Note

Sort only occurs when an instance is constructed or when this method is called.

public String
toFormulaString()

Implements abstract org.apache.poi.ss.formula.ptg.Ptg.toFormulaString.

return a string representation of this token alone

protected final void
Inherited from org.apache.poi.ss.formula.ptg.OperandPtg:
copyisBaseToken

Field Detail

colRelativeback to summary
private static final BitField colRelative
columnMaskback to summary
private static final BitField columnMask
field_1_first_rowback to summary
private int field_1_first_row

zero based, unsigned 16 bit

field_2_last_rowback to summary
private int field_2_last_row

zero based, unsigned 16 bit

field_3_first_columnback to summary
private int field_3_first_column

zero based, unsigned 8 bit

field_4_last_columnback to summary
private int field_4_last_column

zero based, unsigned 8 bit

rowRelativeback to summary
private static final BitField rowRelative

Constructor Detail

AreaPtgBaseback to summary
protected AreaPtgBase()
AreaPtgBaseback to summary
protected AreaPtgBase(AreaPtgBase other)
AreaPtgBaseback to summary
protected AreaPtgBase(AreaReference ar)
AreaPtgBaseback to summary
protected AreaPtgBase(int firstRow, int lastRow, int firstColumn, int lastColumn, boolean firstRowRelative, boolean lastRowRelative, boolean firstColRelative, boolean lastColRelative)

Method Detail

formatReferenceAsStringback to summary
protected final String formatReferenceAsString()
getDefaultOperandClassback to summary
public byte getDefaultOperandClass()

Implements abstract org.apache.poi.ss.formula.ptg.Ptg.getDefaultOperandClass.

Annotations
@Override
getFirstColumnback to summary
public final int getFirstColumn()

Implements org.apache.poi.ss.formula.ptg.AreaI.getFirstColumn.

Returns:int

the first column number in the area.

getFirstColumnRawback to summary
public final short getFirstColumnRaw()
Returns:short

the first column number + the options bit settings unstripped

getFirstRowback to summary
public final int getFirstRow()

Implements org.apache.poi.ss.formula.ptg.AreaI.getFirstRow.

Returns:int

the first row in the area

getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getLastColumnback to summary
public final int getLastColumn()

Implements org.apache.poi.ss.formula.ptg.AreaI.getLastColumn.

Returns:int

lastcolumn in the area

getLastColumnRawback to summary
public final short getLastColumnRaw()
Returns:short

last column and bitmask (the raw field)

getLastRowback to summary
public final int getLastRow()

Implements org.apache.poi.ss.formula.ptg.AreaI.getLastRow.

Returns:int

last row in the range (x2 in x1,y1-x2,y2)

isFirstColRelativeback to summary
public final boolean isFirstColRelative()
Returns:boolean

isrelative first column to relative or not

isFirstRowRelativeback to summary
public final boolean isFirstRowRelative()
Returns:boolean

whether or not the first row is a relative reference or not.

isLastColRelativeback to summary
public final boolean isLastColRelative()
Returns:boolean

lastcol relative or not

isLastRowRelativeback to summary
public final boolean isLastRowRelative()
Returns:boolean

last row relative or not

readCoordinatesback to summary
protected final void readCoordinates(LittleEndianInput in)
setFirstColRelativeback to summary
public final void setFirstColRelative(boolean rel)

set whether the first column is relative

setFirstColumnback to summary
public final void setFirstColumn(int colIx)

set the first column in the area

setFirstColumnRawback to summary
public final void setFirstColumnRaw(int column)

set the first column irrespective of the bitmasks

setFirstRowback to summary
public final void setFirstRow(int rowIx)

sets the first row

Parameters
rowIx:int

number (0-based)

setFirstRowRelativeback to summary
public final void setFirstRowRelative(boolean rel)

sets the first row to relative or not

Parameters
rel:boolean

is relative or not.

setLastColRelativeback to summary
public final void setLastColRelative(boolean rel)

set whether the last column should be relative or not

setLastColumnback to summary
public final void setLastColumn(int colIx)

set the last column in the area

setLastColumnRawback to summary
public final void setLastColumnRaw(short column)

set the last column irrespective of the bitmasks

setLastRowback to summary
public final void setLastRow(int rowIx)
Parameters
rowIx:int

last row number in the area

setLastRowRelativeback to summary
public final void setLastRowRelative(boolean rel)

set whether the last row is relative or not

Parameters
rel:boolean

true if the last row relative, else false

sortTopLeftToBottomRightback to summary
public void sortTopLeftToBottomRight()

Sort the first and last row and columns in-place to the preferred (top left:bottom right) order

Note

Sort only occurs when an instance is constructed or when this method is called.

For example, $E5:B$10 becomes B5:$E$10

toFormulaStringback to summary
public String toFormulaString()

Implements abstract org.apache.poi.ss.formula.ptg.Ptg.toFormulaString.

Doc from org.apache.poi.ss.formula.ptg.Ptg.toFormulaString.

return a string representation of this token alone

writeCoordinatesback to summary
protected final void writeCoordinates(LittleEndianOutput out)