/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param es the sheet * @param nt the name table */ public BooleanFormulaRecord(Record t, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, SheetImpl si) { super(t, fr, si); externalSheet = es; nameTable = nt; value = false; data = getRecord().getData(); Assert.verify(data[6] != 2); value = data[8] == 1 ? true : false; }
/** * Gets the raw bytes for the formula. This will include the * parsed tokens array * * @return the raw record data */ public byte[] getFormulaData() throws FormulaException { if (!getSheet().getWorkbookBof().isBiff8()) { throw new FormulaException(FormulaException.BIFF8_SUPPORTED); } // Lop off the standard information byte[] d = new byte[data.length - 6]; System.arraycopy(data, 6, d, 0, data.length - 6); return d; }
/** * Static class for a dummy override, indicating that the formula * passed in is not a shared formula */ private static class IgnoreSharedFormula {}; public static final IgnoreSharedFormula ignoreSharedFormula
/** * Static class for a dummy override, indicating that the formula * passed in is not a shared formula */ private static class IgnoreSharedFormula {}; public static final IgnoreSharedFormula ignoreSharedFormula
formula = new BooleanFormulaRecord(t, fr, es, nt, si);
/** * Gets the raw bytes for the formula. This will include the * parsed tokens array * * @return the raw record data */ public byte[] getFormulaData() throws FormulaException { if (!getSheet().getWorkbookBof().isBiff8()) { throw new FormulaException(FormulaException.BIFF8_SUPPORTED); } // Lop off the standard information byte[] d = new byte[data.length - 6]; System.arraycopy(data, 6, d, 0, data.length - 6); return d; }
/** * Constructs this object from the raw data * * @param t the raw data * @param fr the formatting records * @param si the sheet * @param es the sheet * @param nt the name table */ public BooleanFormulaRecord(Record t, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, SheetImpl si) { super(t, fr, si); externalSheet = es; nameTable = nt; value = false; data = getRecord().getData(); Assert.verify(data[6] != 2); value = data[8] == 1 ? true : false; }
formula = new BooleanFormulaRecord(t, fr, es, nt, si);
/** * Gets the formula as an excel string * * @return the formula as an excel string * @exception FormulaException */ public String getFormula() throws FormulaException { if (formulaString == null) { byte[] tokens = new byte[data.length - 22]; System.arraycopy(data, 22, tokens, 0, tokens.length); FormulaParser fp = new FormulaParser (tokens, this, externalSheet, nameTable, getSheet().getWorkbook().getSettings()); fp.parse(); formulaString = fp.getFormula(); } return formulaString; } }
/** * Gets the formula as an excel string * * @return the formula as an excel string * @exception FormulaException */ public String getFormula() throws FormulaException { if (formulaString == null) { byte[] tokens = new byte[data.length - 22]; System.arraycopy(data, 22, tokens, 0, tokens.length); FormulaParser fp = new FormulaParser (tokens, this, externalSheet, nameTable, getSheet().getWorkbook().getSettings()); fp.parse(); formulaString = fp.getFormula(); } return formulaString; } }