public class PtgRef extends GenericPtg implements Ptg
Offset Name Size Contents
----------------------------------------------------
0 rw 2 the row
2 grbitCol 2 (see following table)
Only the low-order 14 bits specify the Col, the other bits specify
relative vs absolute for both the col or the row.
Bits Mask Name Contents
-----------------------------------------------------
15 8000h fRwRel =1 if row offset relative,
=0 if otherwise
14 4000h fColRel =1 if col offset relative,
=0 if otherwise
13-0 3FFFh col Ordinal column offset or number
WorkBook,
Boundsheet,
Dbcell,
Row,
Cell,
XLSRecord,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected int |
col |
protected int |
externalLink1 |
protected int |
externalLink2 |
protected boolean |
fColRel |
protected int |
formulaCol |
protected int |
formulaRow |
protected boolean |
fRwRel |
long |
hashcode |
protected boolean |
is3dRef |
protected int |
rw |
protected String |
sheetname |
protected boolean |
useReferenceTracker |
boolean |
wholeCol |
boolean |
wholeRow |
parent_recARRAY, CALCULATED, PTG_ADD_LENGTH, PTG_AREA_LENGTH, PTG_AREA3D_LENGTH, PTG_AREAERR3D_LENGTH, PTG_ATR_LENGTH, PTG_BOOL_LENGTH, PTG_CONCAT_LENGTH, PTG_DIV_LENGTH, PTG_ENDSHEET_LENGTH, PTG_EQ_LENGTH, PTG_EXP_LENGTH, PTG_FUNC_LENGTH, PTG_FUNCVAR_LENGTH, PTG_GE_LENGTH, PTG_GT_LENGTH, PTG_INT, PTG_INT_LENGTH, PTG_ISECT_LENGTH, PTG_LE_LENGTH, PTG_LOCATION_POLICY_LOCKED, PTG_LOCATION_POLICY_TRACK, PTG_LOCATION_POLICY_UNLOCKED, PTG_LT_LENGTH, PTG_MEM_AREA_N_LENGTH, PTG_MEM_AREA_NV_LENGTH, PTG_MEMERR_LENGTH, PTG_MLT_LENGTH, PTG_MYSTERY_LENGTH, PTG_NAME_LENGTH, PTG_NAMEX_LENGTH, PTG_NE_LENGTH, PTG_NUM_LENGTH, PTG_PAREN_LENGTH, PTG_PERCENT_LENGTH, PTG_POWER_LENGTH, PTG_RANGE_LENGTH, PTG_REF_LENGTH, PTG_REF3D_LENGTH, PTG_REFERR_LENGTH, PTG_REFERR3D_LENGTH, PTG_SUB_LENGTH, PTG_TYPE_ARRAY, PTG_TYPE_SINGLE, PTG_UMINUS_LENGTH, PTG_UNION_LENGTH, PTG_UPLUS_LENGTH, REFERENCE, UNCALCULATED, VALUEAI, ALLOWDUPES, ALRUNS, AREA, AREAFORMAT, ATTACHEDLABEL, AUTOFILTER, AXCENT, AXESUSED, AXIS, AXISLINEFORMAT, AXISPARENT, BACKUP, BAR, BEGIN, BLANK, BOF, BOOKBOOL, BOOLERR, BOPPOP, BOPPOPCUSTOM, BOTTOM_MARGIN, BOTTOMMARGIN, BOUNDSHEET, CALC_MODE_PROP, CALCCOUNT, CALCMODE, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, CATLAB, CATSERRANGE, CF, CF12, CHART, CHART3DBARSHAPE, CHARTFORMAT, CHARTFORMATLINK, CHARTFRTINFO, CHARTLINE, CODENAME, COLINFO, CONDFMT, CONDFMT12, CONTINUE, COUNTRY, CRN, CRTLAYOUT12, CRTLAYOUT12A, DAT, DATAFORMAT, DATALABEXT, DATALABEXTCONTENTS, DATE1904, DBCELL, DCON, DCONBIN, DCONNAME, DCONREF, DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM, DEFAULTENCODING, DEFAULTROWHEIGHT, DEFAULTTEXT, DEFCOLWIDTH, DELTA, DIMENSIONS, DROPBAR, DSF, DV, DVAL, END, ENDBLOCK, ENDEXTSST, ENDOBJECT, EOF, EXCEL2K, EXTERNCOUNT, EXTERNNAME, EXTERNSHEET, EXTSST, FBI, FEATHEADR, FILE_LOCK, FILEPASS, FONT, FONTBASIS, FONTX, FOOTERREC, FORMAT, FORMULA, FRAME, FRTFONTLIST, FRTWRAPPER, GARBAGE, GELFRAME, GUTS, HCENTER, HEADERREC, HLINK, HORIZONTAL_PAGE_BREAKS, IFMT, INDEX, INTERFACE_HDR, ITERATION, LABEL, LABELSST, LEFT_MARGIN, LEFTMARGIN, LEGEND, LEGENDXN, LINE, LINEFORMAT, MARKERFORMAT, MAXCOLS, MAXCOLS_BIFF8, MAXRECLEN, MAXROWS, MAXROWS_BIFF8, MERGEDCELLS, MSODRAWING, MSODRAWINGGROUP, MSODRAWINGSELECTION, MULBLANK, MULRK, NAME, NOTE, NUMBER, OBJ, OBJECTLINK, OBJPROTECT, OBPROJ, PALETTE, PANE, PASSWORD, PHONETIC, PICF, PIE, PIEFORMAT, PIVOTCHARTBITS, PIVOTCHARTLINK, PLOTAREA, PLOTGROWTH, PLS, PLV, POS, PRECISION, PRINT_GRIDLINES, PRINT_ROW_HEADERS, PRINTGRID, PRINTROWCOL, PROT4REV, PROTECT, QSISXTAG, RADAR, RADARAREA, RANGEPROTECTION, REFMODE, REFTRACK_PROP, RIGHT_MARGIN, RIGHTMARGIN, RK, ROW, RRD_HEAD, RRD_INFO, RSTRING, RTENTEXU, RTMERGECELLS, SBASEREF, SCATTER, SCENPROTECT, SCL, SELECTION, SERAUXERRBAR, SERAUXTREND, SERFMT, SERIES, SERIESLIST, SERIESTEXT, SERPARENT, SERTOCRT, SETUP, SHAREDUPES, SHEETLAYOUT, SHEETPROTECTION, SHRFMLA, SHTPROPS, SIIINDEX, SST, STARTBLOCK, STARTOBJECT, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE, STRINGREC, STYLE, SUPBOOK, SURFACE, SXADDL, SXBOOL, SXDB, SXDBB, SXDBEX, SXDI, SXEX, SXFDB, SXFDBTYPE, SXFORMAT, SXIVD, SXLI, SXNUM, SXPI, SXSTREAMID, SXSTRING, SXVD, SXVDEX, SXVI, SXVIEW, SXVIEWEX9, SXVIEWLINK, SXVS, TABID, TABLE, TABLESTYLES, TEXTDISP, THREED, TICK, TOP_MARGIN, TOPMARGIN, TXO, TYPE_BLANK, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FORMULA, TYPE_FP, TYPE_INT, TYPE_STRING, UNICODEENCODING, UNITS, USERBVIEW, USERSVIEWBEGIN, USERSVIEWEND, USETEMPFILE_PROP, USR_EXCL, VALIDATEWORKBOOK, VALUERANGE, VB_MODULE, VCENTER, VERTICAL_PAGE_BREAKS, WINDOW_PROTECT, WINDOW1, WINDOW2, WK_CHART, WK_FILE, WK_GLOBALS, WK_MACROSHEET, WK_WORKSHEET, WSBOOL, XCT, XF, XLS_MAX_COLS, YMULT| Constructor and Description |
|---|
PtgRef()
default constructor
|
PtgRef(byte[] bin,
XLSRecord x,
boolean utilizeRefTracker)
This constructor is for programmatic creation of Ptg's
in this case we do not have the ptgid, just the refereced location
this version sets the value of useReferenceTracker to avoid multiple entries due to area parent
|
PtgRef(int[] rowcol,
XLSRecord x,
boolean useRefTracker) |
PtgRef(String location,
XLSRecord x,
boolean utilizeRefTracker)
This constructor is for programmatic creation of Ptg's
in this case we do not have the ptgid, just the refereced location
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToRefTracker()
add this reference to the ReferenceTracker...
|
boolean |
changeLocation(String newLoc,
Formula f) |
void |
clearLocationCache()
Clears the location cache when needed
|
void |
close()
clear out object references in prep for closing workbook
|
static Ptg |
createPtgRefFromString(String address,
XLSRecord parent)
given an address string, parse and assign to the appropriate PtgRef-type object
#REF! 's return either PtgRefErr or PtgRefErr3d Ranges return either PtgArea or PtgArea3d Single addresses return either PtgRef or PtgRef3d NOTE: This method does not extract names embedded within the address string |
boolean |
equals(Object ob) |
String |
getFormattedValue()
returns the value of the ptg formatted via the underlying cell's number format
|
protected long |
getHashCode()
uniquely identifies a row/col
to unencrypt:
col= hashcode%maxcols
row= hashcode/maxcols -1
|
static long |
getHashCode(int row,
int col) |
int[] |
getIntLocation()
Get the location of this ptgRef as an int array {row, col}.
|
boolean |
getIsOperand() |
boolean |
getIsReference() |
boolean |
getIsRefErr() |
boolean |
getIsWholeCol() |
boolean |
getIsWholeRow() |
int |
getLength()
return the length of the Ptg
|
String |
getLocation()
Returns the location of the Ptg as a string (ie c4)
|
String |
getLocationWithSheet()
returns the String address of this ptg including sheet reference
|
int[] |
getRealIntLocation()
Get the location of this ptgRef as an int array {row, col}.
|
BiffRec[] |
getRefCells() |
int[] |
getRowCol()
returns the row/col ints for the ref
|
String |
getSheetName()
Get the worksheet name this ptgref refers to
|
String |
getString()
return the human-readable String representation of
this ptg -- if applicable
|
boolean |
getUseReferenceTracker() |
Object |
getValue()
returns the value of the cell refereced by the PtgRef
|
void |
init(byte[] b) |
boolean |
is3dRef() |
boolean |
isBlank()
return truth of "reference is blank"
|
boolean |
isColRel() |
boolean |
isRowRel() |
protected void |
populateVals()
parse all the values out of the byte array and
populate the classes values
|
void |
removeFromRefTracker()
removes this reference from the tracker...
|
void |
setArrayTypeRef() |
void |
setColRel(boolean relative)
sets the column to be relative (relative is true) or absolute (relative is false)
absolute references do not shift upon column inserts or deletes |
void |
setExternalReference(String externalWorkbook)
set this Ptg to an External Location - used when copying a sheet from another workbook
|
void |
setIsWholeCol(boolean b) |
void |
setIsWholeRow(boolean b) |
protected void |
setIsWholeRowCol()
Inspects the record to determin if it references whole
rows or columns and sets the values as required.
|
void |
setLocation(int[] rowcol)
Set the location of this PtgRef.
|
void |
setLocation(int[] rowcol,
boolean bRowRel,
boolean bColRel)
set the location of this PtgRef
|
void |
setLocation(String address)
Set the location of this PtgRef.
|
void |
setLocation(String[] loc)
set Ptg to parsed location
|
void |
setParentRec(XLSRecord f)
constructor must pass in 'parent' XLSRecord so that there
is a handle for updating...
|
void |
setPtgType(short type)
set the Ptg Id type to one of:
VALUE, REFERENCE or Array
The Ptg type is important for certain functions which require a specific type of operand |
void |
setRelativeRowCol()
set the formulaRow and formulaCol for relatively-referenced PtgRefs
|
void |
setRowRel(boolean relative)
sets the row to be relative (relative is true) or absolute (relative is false)
absolute references do not shift upon row inserts or deletes |
void |
setSheetName(String sheetname)
sets the sheetname for this
|
void |
setUseReferenceTracker(boolean b)
Ptgs upkeep their mapping in reference tracker, however, some ptgs
are components of other Ptgs, such as individual ptg cells in a PtgArea.
|
String |
toString() |
void |
updateInRefTracker(XLSRecord parent)
update existing tracked ptg with new parent in reference tracker
|
void |
updateRecord()
Updates the record bytes so it can be pulled back out.
|
calculatePtg, clone, evaluate, getArrayLen, getComponents, getDoubleVal, getDoubleValue, getDoubleValueFromObject, getIntVal, getIsArray, getIsBinaryOperator, getIsControl, getIsFunction, getIsOperator, getIsPrimitiveOperator, getIsStandAloneOperator, getIsUnaryOperator, getLocationPolicy, getLock, getNumParams, getOpcode, getParentRec, getPtgVal, getRecord, getString2, getStringValuesFromPtgs, getTextString, getTrackercell, getValuesFromObjects, getValuesFromPtgs, initTrackerCell, qualifyCellAddress, qualifySheetname, readRow, setLocationPolicy, setLock, setTrackercell, setVars, updateAddressFromTrackerCellfinalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcalculatePtg, clone, evaluate, getComponents, getDoubleVal, getIntVal, getIsArray, getIsBinaryOperator, getIsControl, getIsFunction, getIsOperator, getIsPrimitiveOperator, getIsStandAloneOperator, getIsUnaryOperator, getLocationPolicy, getLock, getNumParams, getOpcode, getParentRec, getPtgVal, getRecord, getString2, getTextString, getTrackercell, initTrackerCell, setLocationPolicy, setLock, setTrackercell, setVars, updateAddressFromTrackerCellprotected int rw
protected boolean fRwRel
protected boolean fColRel
protected int col
protected boolean is3dRef
protected int formulaRow
protected int formulaCol
protected String sheetname
protected int externalLink1
protected int externalLink2
protected boolean useReferenceTracker
public long hashcode
public boolean wholeRow
public boolean wholeCol
public PtgRef(int[] rowcol,
XLSRecord x,
boolean useRefTracker)
public PtgRef(String location, XLSRecord x, boolean utilizeRefTracker)
public PtgRef(byte[] bin,
XLSRecord x,
boolean utilizeRefTracker)
public PtgRef()
public boolean getIsWholeRow()
public void setIsWholeRow(boolean b)
public boolean getIsWholeCol()
public void setIsWholeCol(boolean b)
public boolean getIsRefErr()
public boolean getIsOperand()
getIsOperand in interface PtggetIsOperand in class GenericPtgpublic boolean getIsReference()
getIsReference in interface PtggetIsReference in class GenericPtgpublic void setPtgType(short type)
public void init(byte[] b)
init in class GenericPtgpublic void setUseReferenceTracker(boolean b)
public boolean getUseReferenceTracker()
protected void populateVals()
public boolean is3dRef()
public String getString()
getString in interface PtggetString in class GenericPtgpublic String getLocationWithSheet()
public int[] getRowCol()
public void setSheetName(String sheetname)
sheetname - public String getLocation()
getLocation in interface PtggetLocation in class GenericPtgGenericPtg.getLocation()public int[] getIntLocation()
getIntLocation in interface PtggetIntLocation in class GenericPtgpublic int[] getRealIntLocation()
public String getSheetName() throws WorkSheetNotFoundException
WorkSheetNotFoundExceptionpublic void setLocation(String address)
setLocation in interface PtgsetLocation in class GenericPtgpublic void clearLocationCache()
protected void setIsWholeRowCol()
public void setLocation(String[] loc)
loc - String[] sheet1, range, sheet2, exref1, exref2public void setLocation(int[] rowcol)
public static Ptg createPtgRefFromString(String address, XLSRecord parent)
address - parent - parent record to assign the ptg topublic void setLocation(int[] rowcol,
boolean bRowRel,
boolean bColRel)
rowcol - int[] rowcolbRowRel - true if row is relative (i.e. A1 not A$1)bColRel - true if col is relative (i.e. A1 not $A1)public void updateRecord()
updateRecord in interface PtgupdateRecord in class GenericPtgpublic int getLength()
Ptgpublic boolean isBlank()
isBlank in interface PtgisBlank in class GenericPtgpublic Object getValue()
getValue in interface PtggetValue in class GenericPtgpublic String getFormattedValue()
public BiffRec[] getRefCells()
public void setParentRec(XLSRecord f)
PtgsetParentRec in interface PtgsetParentRec in class GenericPtgpublic void removeFromRefTracker()
public void addToRefTracker()
public void updateInRefTracker(XLSRecord parent)
parent - public void setRelativeRowCol()
public void setExternalReference(String externalWorkbook)
f - parent formula recpublic boolean isRowRel()
public boolean isColRel()
public void setColRel(boolean relative)
boolean - relativepublic void setRowRel(boolean relative)
boolean - relativepublic void setArrayTypeRef()
protected long getHashCode()
public static long getHashCode(int row,
int col)
public void close()
close in interface Ptgclose in class GenericPtgCopyright © 2002–2019 Starter Inc.. All rights reserved.