Package org.apache.poi.hssf.record.formula

Examples of org.apache.poi.hssf.record.formula.NamePtg


    }
    public boolean isRange() {
      return _nameRecord.hasFormula(); // TODO - is this right?
    }
    public NamePtg createPtg() {
      return new NamePtg(_index);
    }
View Full Code Here


  /* package */ EvaluationSheet getSheet(int sheetIndex) {
    return _workbook.getSheet(sheetIndex);
  }
 
  /* package */ EvaluationName getName(String name, int sheetIndex) {
    NamePtg namePtg = null;
    if(_workbook instanceof HSSFEvaluationWorkbook){
      namePtg =((HSSFEvaluationWorkbook)_workbook).getName(name, sheetIndex).createPtg();
    }

    if(namePtg == null) {
View Full Code Here

  private ValueEval getEvalForPtg(Ptg ptg, OperationEvaluationContext ec) {
    //  consider converting all these (ptg instanceof XxxPtg) expressions to (ptg.getClass() == XxxPtg.class)

    if (ptg instanceof NamePtg) {
      // named ranges, macro functions
      NamePtg namePtg = (NamePtg) ptg;
      EvaluationName nameRecord = _workbook.getName(namePtg);
      if (nameRecord.isFunctionName()) {
        return new NameEval(nameRecord.getNameText());
      }
      if (nameRecord.hasFormula()) {
View Full Code Here

  private Eval getEvalForPtg(Ptg ptg, int sheetIndex, EvaluationTracker tracker) {
    //  consider converting all these (ptg instanceof XxxPtg) expressions to (ptg.getClass() == XxxPtg.class)

    if (ptg instanceof NamePtg) {
      // named ranges, macro functions
      NamePtg namePtg = (NamePtg) ptg;
      EvaluationName nameRecord = _workbook.getName(namePtg);
      if (nameRecord.isFunctionName()) {
        return new NameEval(nameRecord.getNameText());
      }
      if (nameRecord.hasFormula()) {
View Full Code Here

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

    }
    public boolean isRange() {
      return _nameRecord.hasFormula(); // TODO - is this right?
    }
    public NamePtg createPtg() {
      return new NamePtg(_index);
    }
View Full Code Here

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

    public boolean isRange() {
      return hasFormula(); // TODO - is this right?
    }
    public NamePtg createPtg() {
      return new NamePtg(_index);
    }
View Full Code Here

   * passed here!
   */
  private Eval getEvalForPtg(Ptg ptg, int sheetIndex, EvaluationTracker tracker) {
    if (ptg instanceof NamePtg) {
      // named ranges, macro functions
      NamePtg namePtg = (NamePtg) ptg;
      EvaluationName nameRecord = _workbook.getName(namePtg);
      if (nameRecord.isFunctionName()) {
        return new NameEval(nameRecord.getNameText());
      }
      if (nameRecord.hasFormula()) {
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.formula.NamePtg

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.