Ptg represents a syntactic token in a formula. 'PTG' is an acronym for
'parse thing'. Originally, the name referred to the single
byte identifier at the start of the token, but in POI, Ptg encapsulates
the whole formula token (initial byte + value data).
Ptgs are logically arranged in a tree representing the structure of the
parsed formula. However, in BIFF files Ptgs are written/read in
Reverse-Polish Notation order. The RPN ordering also simplifies formula
evaluation logic, so POI mostly accesses Ptgs in the same way.
| Modifier and Type | Field and Description |
|---|---|
| public static final byte | |
| public static final byte | |
| public static final byte | |
| public static final Ptg[] | |
| private byte |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Ptg | |
| private static Ptg | |
| private static Ptg | |
| public static Ptg | |
| public static boolean | |
| public abstract byte | |
| public static int | Returns: the full size taken to encode the specifiedPtgsThis method will return the same result as |
| public static int | Returns: the size of the encoded Ptg tokens not including any trailing array data.Used to calculate value that should be encoded at the start of the encoded Ptg token array; |
| public final byte | |
| public final char | Returns: 'R' for 'reference', 'V' for 'value', 'A' for 'array' and '.' for base tokensDebug / diagnostic method to get this token's 'operand class' type. |
| public abstract byte | |
| public abstract int | |
| public abstract boolean | |
| private static boolean | |
| public static Ptg[] | readTokens(int size, LittleEndianInput in)
Reads |
| public static int | Returns: number of bytes writtenWrites the ptgs to the data buffer, starting at the specified offset. |
| public final void | |
| public abstract String | |
| private static Ptg[] | |
| public final String | |
| public abstract void |
| CLASS_ARRAY | back to summary |
|---|---|
| public static final byte CLASS_ARRAY | |
| CLASS_REF | back to summary |
|---|---|
| public static final byte CLASS_REF | |
| CLASS_VALUE | back to summary |
|---|---|
| public static final byte CLASS_VALUE | |
| EMPTY_PTG_ARRAY | back to summary |
|---|---|
| public static final Ptg[] EMPTY_PTG_ARRAY | |
| ptgClass | back to summary |
|---|---|
| private byte ptgClass | |
| copy | back to summary |
|---|---|
| public abstract Ptg copy() Redeclares org.
| |
| createBasePtg | back to summary |
|---|---|
| private static Ptg createBasePtg(byte id, LittleEndianInput in) | |
| createClassifiedPtg | back to summary |
|---|---|
| private static Ptg createClassifiedPtg(byte id, LittleEndianInput in) | |
| createPtg | back to summary |
|---|---|
| public static Ptg createPtg(LittleEndianInput in) | |
| doesFormulaReferToDeletedCell | back to summary |
|---|---|
| public static boolean doesFormulaReferToDeletedCell(Ptg[] ptgs) | |
| getDefaultOperandClass | back to summary |
|---|---|
| public abstract byte getDefaultOperandClass() | |
| getEncodedSize | back to summary |
|---|---|
| public static int getEncodedSize(Ptg[] ptgs) This method will return the same result as
| |
| getEncodedSizeWithoutArrayData | back to summary |
|---|---|
| public static int getEncodedSizeWithoutArrayData(Ptg[] ptgs) Used to calculate value that should be encoded at the start of the encoded Ptg token array;
| |
| getPtgClass | back to summary |
|---|---|
public final byte getPtgClass()
| |
| getRVAType | back to summary |
|---|---|
| public final char getRVAType() Debug / diagnostic method to get this token's 'operand class' type.
| |
| getSid | back to summary |
|---|---|
public abstract byte getSid()
| |
| getSize | back to summary |
|---|---|
public abstract int getSize()
| |
| isBaseToken | back to summary |
|---|---|
public abstract boolean isBaseToken()
| |
| isDeletedCellRef | back to summary |
|---|---|
| private static boolean isDeletedCellRef(Ptg ptg) | |
| readTokens | back to summary |
|---|---|
| public static Ptg[] readTokens(int size, LittleEndianInput in) Reads | |
| serializePtgs | back to summary |
|---|---|
| public static int serializePtgs(Ptg[] ptgs, byte[] array, int offset) Writes the ptgs to the data buffer, starting at the specified offset.
| |
| setClass | back to summary |
|---|---|
| public final void setClass(byte thePtgClass) | |
| toFormulaString | back to summary |
|---|---|
| public abstract String toFormulaString() return a string representation of this token alone | |
| toPtgArray | back to summary |
|---|---|
| private static Ptg[] toPtgArray(List<Ptg> l) | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| write | back to summary |
|---|---|
| public abstract void write(LittleEndianOutput out) | |