Package org.apache.poi.ss.formula.ptg
Class AreaPtgBase
- java.lang.Object
-
- org.apache.poi.ss.formula.ptg.Ptg
-
- org.apache.poi.ss.formula.ptg.OperandPtg
-
- org.apache.poi.ss.formula.ptg.AreaPtgBase
-
- All Implemented Interfaces:
Serializable
,Duplicatable
,GenericRecord
,AreaI
- Direct Known Subclasses:
Area2DPtgBase
,Area3DPtg
,Area3DPxg
public abstract class AreaPtgBase extends OperandPtg implements AreaI
Specifies a rectangular area of cells A1:A4 for instance.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.poi.ss.formula.ptg.AreaI
AreaI.OffsetArea
-
-
Field Summary
-
Fields inherited from class org.apache.poi.ss.formula.ptg.Ptg
CLASS_ARRAY, CLASS_REF, CLASS_VALUE, EMPTY_PTG_ARRAY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AreaPtgBase()
protected
AreaPtgBase(int firstRow, int lastRow, int firstColumn, int lastColumn, boolean firstRowRelative, boolean lastRowRelative, boolean firstColRelative, boolean lastColRelative)
protected
AreaPtgBase(AreaPtgBase other)
protected
AreaPtgBase(AreaReference ar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
protected String
formatReferenceAsString()
byte
getDefaultOperandClass()
int
getFirstColumn()
short
getFirstColumnRaw()
int
getFirstRow()
Map<String,Supplier<?>>
getGenericProperties()
int
getLastColumn()
short
getLastColumnRaw()
int
getLastRow()
int
hashCode()
boolean
isFirstColRelative()
boolean
isFirstRowRelative()
boolean
isLastColRelative()
boolean
isLastRowRelative()
protected void
readCoordinates(LittleEndianInput in, SpreadsheetVersion version)
void
setFirstColRelative(boolean rel)
set whether the first column is relativevoid
setFirstColumn(int colIx)
set the first column in the areavoid
setFirstColumnRaw(int column)
set the first column irrespective of the bitmasksvoid
setFirstRow(int rowIx)
sets the first rowvoid
setFirstRowRelative(boolean rel)
sets the first row to relative or notvoid
setLastColRelative(boolean rel)
set whether the last column should be relative or notvoid
setLastColumn(int colIx)
set the last column in the areavoid
setLastColumnRaw(short column)
set the last column irrespective of the bitmasksvoid
setLastRow(int rowIx)
void
setLastRowRelative(boolean rel)
set whether the last row is relative or notvoid
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.String
toFormulaString()
return a string representation of this token aloneprotected void
writeCoordinates(LittleEndianOutput out, SpreadsheetVersion version)
-
Methods inherited from class org.apache.poi.ss.formula.ptg.OperandPtg
copy, isBaseToken
-
Methods inherited from class org.apache.poi.ss.formula.ptg.Ptg
createPtg, createPtg, doesFormulaReferToDeletedCell, getEncodedSize, getEncodedSize, getEncodedSizeWithoutArrayData, getEncodedSizeWithoutArrayData, getPtgClass, getRVAType, getSid, getSize, readTokens, readTokens, serializePtgs, serializePtgs, setClass, toString, write
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
-
-
-
Constructor Detail
-
AreaPtgBase
protected AreaPtgBase()
-
AreaPtgBase
protected AreaPtgBase(AreaPtgBase other)
-
AreaPtgBase
protected AreaPtgBase(AreaReference ar)
-
AreaPtgBase
protected AreaPtgBase(int firstRow, int lastRow, int firstColumn, int lastColumn, boolean firstRowRelative, boolean lastRowRelative, boolean firstColRelative, boolean lastColRelative)
-
-
Method Detail
-
sortTopLeftToBottomRight
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
becomesB5:$E$10
-
readCoordinates
protected final void readCoordinates(LittleEndianInput in, SpreadsheetVersion version)
-
writeCoordinates
protected final void writeCoordinates(LittleEndianOutput out, SpreadsheetVersion version)
-
getFirstRow
public final int getFirstRow()
- Specified by:
getFirstRow
in interfaceAreaI
- Returns:
- the first row in the area
-
setFirstRow
public final void setFirstRow(int rowIx)
sets the first row- Parameters:
rowIx
- number (0-based)
-
getLastRow
public final int getLastRow()
- Specified by:
getLastRow
in interfaceAreaI
- Returns:
- last row in the range (x2 in x1,y1-x2,y2)
-
setLastRow
public final void setLastRow(int rowIx)
- Parameters:
rowIx
- last row number in the area
-
getFirstColumn
public final int getFirstColumn()
- Specified by:
getFirstColumn
in interfaceAreaI
- Returns:
- the first column number in the area.
-
getFirstColumnRaw
public final short getFirstColumnRaw()
- Returns:
- the first column number + the options bit settings unstripped
-
isFirstRowRelative
public final boolean isFirstRowRelative()
- Specified by:
isFirstRowRelative
in interfaceAreaI
- Returns:
- whether or not the first row is a relative reference or not.
-
setFirstRowRelative
public final void setFirstRowRelative(boolean rel)
sets the first row to relative or not- Parameters:
rel
- is relative or not.
-
isFirstColRelative
public final boolean isFirstColRelative()
- Specified by:
isFirstColRelative
in interfaceAreaI
- Returns:
- isrelative first column to relative or not
-
setFirstColRelative
public final void setFirstColRelative(boolean rel)
set whether the first column is relative
-
setFirstColumn
public final void setFirstColumn(int colIx)
set the first column in the area
-
setFirstColumnRaw
public final void setFirstColumnRaw(int column)
set the first column irrespective of the bitmasks
-
getLastColumn
public final int getLastColumn()
- Specified by:
getLastColumn
in interfaceAreaI
- Returns:
- lastcolumn in the area
-
getLastColumnRaw
public final short getLastColumnRaw()
- Returns:
- last column and bitmask (the raw field)
-
isLastRowRelative
public final boolean isLastRowRelative()
- Specified by:
isLastRowRelative
in interfaceAreaI
- Returns:
- last row relative or not
-
setLastRowRelative
public final void setLastRowRelative(boolean rel)
set whether the last row is relative or not- Parameters:
rel
-true
if the last row relative, elsefalse
-
isLastColRelative
public final boolean isLastColRelative()
- Specified by:
isLastColRelative
in interfaceAreaI
- Returns:
- lastcol relative or not
-
setLastColRelative
public final void setLastColRelative(boolean rel)
set whether the last column should be relative or not
-
setLastColumn
public final void setLastColumn(int colIx)
set the last column in the area
-
setLastColumnRaw
public final void setLastColumnRaw(short column)
set the last column irrespective of the bitmasks
-
formatReferenceAsString
protected final String formatReferenceAsString()
-
toFormulaString
public String toFormulaString()
Description copied from class:Ptg
return a string representation of this token alone- Specified by:
toFormulaString
in classPtg
-
getDefaultOperandClass
public byte getDefaultOperandClass()
- Specified by:
getDefaultOperandClass
in classPtg
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericProperties
in interfaceGenericRecord
-
-