|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hssf.record.formula.Ptg
public abstract class Ptg
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.
Field Summary | |
---|---|
static byte |
CLASS_ARRAY
|
static byte |
CLASS_REF
|
static byte |
CLASS_VALUE
|
Constructor Summary | |
---|---|
Ptg()
|
Method Summary | |
---|---|
protected java.lang.Object |
clone()
|
Ptg |
copy()
|
static java.util.Stack |
createParsedExpressionTokens(short size,
RecordInputStream in)
Deprecated. - use readTokens() |
static Ptg |
createPtg(RecordInputStream in)
|
byte[] |
getBytes()
|
abstract byte |
getDefaultOperandClass()
|
static int |
getEncodedSize(Ptg[] ptgs)
|
static int |
getEncodedSize(java.util.Stack ptgs)
|
byte |
getPtgClass()
|
abstract int |
getSize()
|
abstract boolean |
isBaseToken()
|
static Ptg[] |
readTokens(int size,
RecordInputStream in)
Reads size bytes of the input stream, to create an array of Ptgs. |
static int |
serializePtgs(Ptg[] ptgs,
byte[] data,
int offset)
Writes the ptgs to the data buffer, starting at the specified offset. |
static int |
serializePtgStack(java.util.Stack expression,
byte[] array,
int offset)
Deprecated. use serializePtgs() |
void |
setClass(byte thePtgClass)
|
java.lang.String |
toDebugString()
dump a debug representation (hexdump) to a string |
abstract java.lang.String |
toFormulaString(HSSFWorkbook book)
return a string representation of this token alone |
java.lang.String |
toString()
Overridden toString method to ensure object hash is not printed. |
abstract void |
writeBytes(byte[] array,
int offset)
write this Ptg to a byte array |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte CLASS_REF
public static final byte CLASS_VALUE
public static final byte CLASS_ARRAY
Constructor Detail |
---|
public Ptg()
Method Detail |
---|
public static Ptg[] readTokens(int size, RecordInputStream in)
public static java.util.Stack createParsedExpressionTokens(short size, RecordInputStream in)
public static Ptg createPtg(RecordInputStream in)
public static int getEncodedSize(java.util.Stack ptgs)
public final Ptg copy()
protected java.lang.Object clone()
clone
in class java.lang.Object
public static int getEncodedSize(Ptg[] ptgs)
public static int serializePtgs(Ptg[] ptgs, byte[] data, int offset)
public static int serializePtgStack(java.util.Stack expression, byte[] array, int offset)
public abstract int getSize()
public final byte[] getBytes()
public abstract void writeBytes(byte[] array, int offset)
public abstract java.lang.String toFormulaString(HSSFWorkbook book)
public final java.lang.String toDebugString()
public java.lang.String toString()
toString
in class java.lang.Object
public final void setClass(byte thePtgClass)
public final byte getPtgClass()
public abstract byte getDefaultOperandClass()
public abstract boolean isBaseToken()
false
if this token is classified as 'reference', 'value', or 'array'
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |