Package org.apache.poi.ss.formula.ptg

Examples of org.apache.poi.ss.formula.ptg.NamePtg


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

    if(namePtg == null) {
      return null;
    } else {
      return _workbook.getName(namePtg);
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

  /* package */ EvaluationWorkbook getWorkbook() {
    return _workbook;
  }

  /* package */ EvaluationName getName(String name, int sheetIndex) {
        NamePtg namePtg = _workbook.getName(name, sheetIndex).createPtg();

    if(namePtg == null) {
      return null;
    } else {
      return _workbook.getName(namePtg);
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

    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

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

    public boolean isRange() {
      return hasFormula(); // TODO - is this right?
    }
    public NamePtg createPtg() {
      return new NamePtg(_index);
    }
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);
           return getEvalForNameRecord(nameRecord, ec);
       }
       if (ptg instanceof NameXPtg) {
           // Externally defined named ranges or macro functions
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

TOP

Related Classes of org.apache.poi.ss.formula.ptg.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.