public class Formula extends java.lang.Object implements GenericRecord
| Modifier and Type | Method and Description |
|---|---|
Formula |
copy() |
static Formula |
create(Ptg[] ptgs)
Creates a Formula object from a supplied
Ptg array. |
int |
getEncodedSize() |
int |
getEncodedTokenSize()
This method is often used when the formula length does not appear immediately before
the encoded token data.
|
CellReference |
getExpReference()
Gets the locator for the corresponding
SharedFormulaRecord,
ArrayRecord or TableRecord
if this formula belongs to such a grouping. |
java.util.Map<java.lang.String,java.util.function.Supplier<?>> |
getGenericProperties() |
Ptg[] |
getTokens() |
static Ptg[] |
getTokens(Formula formula)
Gets the
Ptg array from the supplied Formula. |
boolean |
isSame(Formula other) |
static Formula |
read(int encodedTokenLen,
LittleEndianInput in)
Convenience method for
read(int, LittleEndianInput, int) |
static Formula |
read(int encodedTokenLen,
LittleEndianInput in,
int totalEncodedLen)
When there are no array constants present,
encodedTokenLen==totalEncodedLen |
void |
serialize(LittleEndianOutput out)
Writes The formula encoding is includes:
ushort tokenDataLen
tokenData
arrayConstantData (if present)
|
void |
serializeArrayConstantData(LittleEndianOutput out) |
void |
serializeTokens(LittleEndianOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGenericChildren, getGenericRecordTypepublic Formula(Formula other)
public static Formula read(int encodedTokenLen, LittleEndianInput in)
read(int, LittleEndianInput, int)public static Formula read(int encodedTokenLen, LittleEndianInput in, int totalEncodedLen)
encodedTokenLen==totalEncodedLenencodedTokenLen - number of bytes in the stream taken by the plain formula tokenstotalEncodedLen - the total number of bytes in the formula (includes trailing encoding
for array constants, but does not include 2 bytes for initial ushort encodedTokenLen field.null.public Ptg[] getTokens()
public void serialize(LittleEndianOutput out)
public void serializeTokens(LittleEndianOutput out)
public void serializeArrayConstantData(LittleEndianOutput out)
public int getEncodedSize()
tokenDataLengthpublic int getEncodedTokenSize()
public static Formula create(Ptg[] ptgs)
Ptg array.
Handles nulls OK.ptgs - may be nullnull (Possibly empty if the supplied ptgs is null)public static Ptg[] getTokens(Formula formula)
Ptg array from the supplied Formula.
Handles nulls OK.formula - may be nullnull (if the supplied formula is null)public Formula copy()
public CellReference getExpReference()
SharedFormulaRecord,
ArrayRecord or TableRecord
if this formula belongs to such a grouping. The CellReference
returned by this method will match the top left corner of the range of that grouping.
The return value is usually not the same as the location of the cell containing this formula.null if this formula is not part of an array or shared formula.public boolean isSame(Formula other)
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
getGenericProperties in interface GenericRecordCopyright 2022 The Apache Software Foundation or its licensors, as applicable.