Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.SharedFormulaRecord


    }
    _arrayRecords = toList(arrayRecords);
    _tableRecords = tableRecords;
    Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<SharedFormulaRecord, SharedFormulaGroup>(nShF * 3 / 2);
    for (int i = 0; i < nShF; i++) {
      SharedFormulaRecord sfr = sharedFormulaRecords[i];
      m.put(sfr, new SharedFormulaGroup(sfr, firstCells[i]));
    }
    _groupsBySharedFormulaRecord = m;
  }
View Full Code Here


      ArrayRecord[] arrayRecords, TableRecord[] tableRecords) {
    _arrayRecords = arrayRecords;
    _tableRecords = tableRecords;
    Map m = new HashMap(sharedFormulaRecords.length * 3 / 2);
    for (int i = 0; i < sharedFormulaRecords.length; i++) {
      SharedFormulaRecord sfr = sharedFormulaRecords[i];
      m.put(sfr, new SharedValueGroup(sfr));
    }
    _groupsBySharedFormulaRecord = m;
  }
View Full Code Here

   * doesn't identify any of them.
   * @return <code>true</code> if the underlying shared formulas are the same
   */
  private static boolean sharedFormulasAreSame(SharedValueGroup grpA, SharedValueGroup grpB) {
    // safe to cast here because this findGroup() is never called for ARRAY or TABLE formulas
    SharedFormulaRecord sfrA = (SharedFormulaRecord) grpA.getSVR();
    SharedFormulaRecord sfrB = (SharedFormulaRecord) grpB.getSVR();
    return sfrA.isFormulaSame(sfrB);
  }
View Full Code Here

    notifyFormulaChanging();
    _formulaRecord.setParsedExpression(ptgs);
  }

  public void unlinkSharedFormula() {
    SharedFormulaRecord sfr = _sharedFormulaRecord;
    if (sfr == null) {
      throw new IllegalStateException("Formula not linked to shared formula");
    }
    Ptg[] ptgs = sfr.getFormulaTokens(_formulaRecord);
    _formulaRecord.setParsedExpression(ptgs);
    //Now its not shared!
    _formulaRecord.setSharedFormula(false);
    _sharedFormulaRecord = null;
  }
View Full Code Here

     */
    public void testSharedFormula()
    {
        List records = new ArrayList();
        records.add( new FormulaRecord() );
        records.add( new SharedFormulaRecord() );

        valueRecord.construct( 0, records );
        Iterator iterator = valueRecord.getIterator();
        Record record = (Record) iterator.next();
        assertNotNull( "Row contains a value", record );
View Full Code Here

   */
    @SuppressWarnings("deprecation") // uses deprecated {@link ValueRecordsAggregate#getValueRecords()}
  public void testSharedFormula() {
    List<Record> records = new ArrayList<Record>();
    records.add(new FormulaRecord());
    records.add(new SharedFormulaRecord());
    records.add(new WindowTwoRecord());

    constructValueRecord(records);
    CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
    //Ensure that the SharedFormulaRecord has been converted
View Full Code Here

    notifyFormulaChanging();
    _formulaRecord.setParsedExpression(ptgs);
  }

  public void unlinkSharedFormula() {
    SharedFormulaRecord sfr = _sharedFormulaRecord;
    if (sfr == null) {
      throw new IllegalStateException("Formula not linked to shared formula");
    }
    Ptg[] ptgs = sfr.getFormulaTokens(_formulaRecord);
    _formulaRecord.setParsedExpression(ptgs);
    //Now its not shared!
    _formulaRecord.setSharedFormula(false);
    _sharedFormulaRecord = null;
  }
View Full Code Here

    }
    _arrayRecords = arrayRecords;
    _tableRecords = tableRecords;
    Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<SharedFormulaRecord, SharedFormulaGroup>(nShF * 3 / 2);
    for (int i = 0; i < nShF; i++) {
      SharedFormulaRecord sfr = sharedFormulaRecords[i];
      m.put(sfr, new SharedFormulaGroup(sfr, firstCells[i]));
    }
    _groupsBySharedFormulaRecord = m;
  }
View Full Code Here

    }
    _arrayRecords = toList(arrayRecords);
    _tableRecords = tableRecords;
    Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<SharedFormulaRecord, SharedFormulaGroup>(nShF * 3 / 2);
    for (int i = 0; i < nShF; i++) {
      SharedFormulaRecord sfr = sharedFormulaRecords[i];
      m.put(sfr, new SharedFormulaGroup(sfr, firstCells[i]));
    }
    _groupsBySharedFormulaRecord = m;
  }
View Full Code Here

    }
    _arrayRecords = toList(arrayRecords);
    _tableRecords = tableRecords;
    Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<SharedFormulaRecord, SharedFormulaGroup>(nShF * 3 / 2);
    for (int i = 0; i < nShF; i++) {
      SharedFormulaRecord sfr = sharedFormulaRecords[i];
      m.put(sfr, new SharedFormulaGroup(sfr, firstCells[i]));
    }
    _groupsBySharedFormulaRecord = m;
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.SharedFormulaRecord

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.