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

pack-priv final Class ParseNode

extends Object
Class Inheritance
Imports
org.apache.poi.ss.formula.ptg.ArrayPtg, .AttrPtg, .FuncVarPtg, .MemAreaPtg, .MemFuncPtg, .Ptg, org.apache.poi.ss.formula.function.FunctionMetadataRegistry

Represents a syntactic element from a formula by encapsulating the corresponding Ptg token. Each ParseNode may have child ParseNodes in the case when the wrapped Ptg is non-atomic.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ParseNode[]
private final boolean
private final Ptg
private final int
public static final ParseNode[]

Constructor Summary

AccessConstructor and Description
public
ParseNode(Ptg token, ParseNode[] children)

public
ParseNode(Ptg token)

public
ParseNode(Ptg token, ParseNode child0)

public
ParseNode(Ptg token, ParseNode child0, ParseNode child1)

Method Summary

Modifier and TypeMethod and Description
private void
collectIfPtgs(ParseNode.TokenCollector temp)

The IF() function gets marked up with two or three tAttr tokens.

private void
public ParseNode[]
public int
public Ptg
private int
private static boolean
isIf(Ptg token)

public static Ptg[]
toTokenArray(ParseNode rootNode)

Collects the array of Ptg tokens for the specified tree.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_childrenback to summary
private final ParseNode[] _children
_isIfback to summary
private final boolean _isIf
_tokenback to summary
private final Ptg _token
_tokenCountback to summary
private final int _tokenCount
EMPTY_ARRAYback to summary
public static final ParseNode[] EMPTY_ARRAY

Constructor Detail

ParseNodeback to summary
public ParseNode(Ptg token, ParseNode[] children)
ParseNodeback to summary
public ParseNode(Ptg token)
ParseNodeback to summary
public ParseNode(Ptg token, ParseNode child0)
ParseNodeback to summary
public ParseNode(Ptg token, ParseNode child0, ParseNode child1)

Method Detail

collectIfPtgsback to summary
private void collectIfPtgs(ParseNode.TokenCollector temp)

The IF() function gets marked up with two or three tAttr tokens. Similar logic will be required for CHOOSE() when it is supported See excelfileformat.pdf sec 3.10.5 "tAttr (19H)

collectPtgsback to summary
private void collectPtgs(ParseNode.TokenCollector temp)
getChildrenback to summary
public ParseNode[] getChildren()
getEncodedSizeback to summary
public int getEncodedSize()
getTokenback to summary
public Ptg getToken()
getTokenCountback to summary
private int getTokenCount()
isIfback to summary
private static boolean isIf(Ptg token)
toTokenArrayback to summary
public static Ptg[] toTokenArray(ParseNode rootNode)

Collects the array of Ptg tokens for the specified tree.

org.apache.poi.ss.formula back to summary

private final Class ParseNode.TokenCollector

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
private final Ptg[]

Constructor Summary

AccessConstructor and Description
public
TokenCollector(int tokenCount)

Method Summary

Modifier and TypeMethod and Description
public void
add(Ptg token)

public int
public Ptg[]
public void
setPlaceholder(int index, Ptg token)

public int
sumTokenSizes(int fromIx, int toIx)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_offsetback to summary
private int _offset
_ptgsback to summary
private final Ptg[] _ptgs

Constructor Detail

TokenCollectorback to summary
public TokenCollector(int tokenCount)

Method Detail

addback to summary
public void add(Ptg token)
createPlaceholderback to summary
public int createPlaceholder()
getResultback to summary
public Ptg[] getResult()
setPlaceholderback to summary
public void setPlaceholder(int index, Ptg token)
sumTokenSizesback to summary
public int sumTokenSizes(int fromIx, int toIx)