Examples of CellRange


Examples of org.formulacompiler.spreadsheet.internal.CellRange

  }


  private final CellRange parseNamedRef( String _ident )
  {
    final CellRange ref = this.workbook.getModelRangeNames().get( _ident );
    if (null == ref) {
      throw new InnerParserException( new CompilerException.UnsupportedExpression( "The name '"
          + _ident + "' is not defined in this spreadsheet." ) );
    }
    return ref;
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

  @Override
  protected final ExpressionNode makeNamedRangeRef( Token _name )
  {
    final String name = _name.image;
    final CellRange range = parseNamedRef( name );
    if (range instanceof CellIndex) {
      final CellIndex cell = (CellIndex) range;
      return new ExpressionNodeForCell( cell, name );
    }
    else {
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

    if (_reference instanceof CellIndex) {
      final CellIndex cell = (CellIndex) _reference;
      return new ExpressionNodeForCell( cell );
    }
    else if (_reference instanceof CellRange) {
      final CellRange range = (CellRange) _reference;
      return new ExpressionNodeForRange( range );
    }
    throw new IllegalArgumentException( "Reference must be a cell or range" );
  }
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

      }
    }
    else if (!_allowRanges && node instanceof ExpressionNodeForRange) {
      try {
        final ExpressionNodeForRange nodeForRange = (ExpressionNodeForRange) node;
        final CellRange range = nodeForRange.getRange();
        final CellIndex cell = range.getCellIndexRelativeTo( this.cellIndex );
        _nodeSource.setExpressionNode( new ExpressionNodeForCell( cell, nodeForRange.getName() ) );
      } catch (SpreadsheetException e) {
        throw new InnerParserException( e );
      }
    }
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

  }


  SectionModelCompiler createSectionCompiler( SectionBinding _sectionDef )
  {
    final CellRange range = _sectionDef.getRange();
    final BaseSpreadsheet spreadsheet = range.getFrom().getSheet().getSpreadsheet();
    final Set<String> names = spreadsheet.getNamesFor( range );
    final String name = names != null && !names.isEmpty() ? names.iterator().next() : null;
    final RangeAddress rangeAddress = range.getRangeAddress();
    final SectionModel model = new SectionModel( getSectionModel(), rangeAddress, name,
        _sectionDef.getInputClass(), _sectionDef.getOutputClass() );
    model.makeInput( _sectionDef.getCallChainToCall() );
    if (_sectionDef.getCallToImplement() != null) {
      model.makeOutput( _sectionDef.getCallToImplement() );
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

      final CellIndex cell = ((ExpressionNodeForCell) _exprDef).getCellIndex();
      return buildExpressionModelForCell( cell );
    }
    else if (_exprDef instanceof ExpressionNodeForRangeShape) {
      final ExpressionNode expressionNode = _exprDef.arguments().get( 0 );
      final CellRange range;
      if (expressionNode instanceof ExpressionNodeForRange) {
        range = ((ExpressionNodeForRange) expressionNode).getRange();
      }
      else if (expressionNode instanceof ExpressionNodeForCell) {
        range = ((ExpressionNodeForCell) expressionNode).getCellIndex();
      }
      else {
        throw new IllegalArgumentException();
      }
      return new RangeExpressionBuilder( range, true ).build();
    }
    else if (_exprDef instanceof ExpressionNodeForRange) {
      final CellRange range = ((ExpressionNodeForRange) _exprDef).getRange();
      return new RangeExpressionBuilder( range, false ).build();
    }
    else {
      final ExpressionNode result = _exprDef.cloneWithoutArguments();
      for (ExpressionNode arg : _exprDef.arguments()) {
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

      /*
       * This loop relies on the subsections of the current section being sorted in ascending
       * flow order.
       */
      CellRange next = range;
      for (SectionBinding inner : this.sectionDef.getSections()) {
        final CellRange innerRange = inner.getRange();
        final Orientation innerOrient = inner.getOrientation();
        final CellRange[] tiling = (innerOrient == ownOrient) ? next.tilingAround( innerRange, innerOrient ) : next
            .tilingAround( innerRange );
        switch (tiling.length) {

          case CellRange.NO_INTERSECTION:
            break;

          case CellRange.CONTAINED: {
            final ExpressionNode expr = buildExpressionModelForInnerRange( inner, next );
            elts.add( expr );
            next = null;
            break;
          }

          case CellRange.FLOW_TILES: {
            final CellRange before = tiling[ CellRange.FLOW_BEFORE ];
            if (null != before) {
              /*
               * This is where we rely on proper sorting. It ensures that `before` cannot
               * possibly overlap one of the remaining inner section to scan.
               */
 
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

      if (this.stepOutOnly) {
        throw new CompilerException.ReferenceToOuterInnerCell();
      }

      makeDynamic( _inner.getOrientation() );
      final CellRange innerRange = _inner.getPrototypeRange( _range );
      final SectionPath path = new SectionPath( SectionModelCompiler.this );
      path.stepInto( _inner );
      final SectionModelCompiler innerDef = path.getSectionCompiler();
      final ExpressionNode expr = innerDef.new RangeExpressionBuilder( this, innerRange, shaped )
          .buildContainedRange();
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

      if (_outputClass == null) throw new IllegalArgumentException( "outputClass is null" );
      validateImplementable( _outputCallToImplementIterable );
      Util.validateIsImplementable( _outputClass, "output class" );
    }

    final CellRange cellRange = (CellRange) _range;
    checkSection( cellRange, _orientation );
    SectionBinding result = new SectionBinding( this, _inputCallChainReturningIterable, _inputClass,
        _outputCallToImplementIterable, _outputClass, cellRange, _orientation );
    this.sections.add( result );
    return result;
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.CellRange

        final int xlsEndSheet = xlsRange[ 0 ].getLastSheetIndex();
        final jxl.Cell xlsStart = xlsRange[ 0 ].getTopLeft();
        final jxl.Cell xlsEnd = xlsRange[ 0 ].getBottomRight();
        final CellIndex start = new CellIndex( _workbook, xlsStartSheet, xlsStart.getColumn(), true, xlsStart.getRow(), true );
        final CellIndex end = new CellIndex( _workbook, xlsEndSheet, xlsEnd.getColumn(), true, xlsEnd.getRow(), true );
        final CellRange range = CellRange.getCellRange( start, end );
        _workbook.defineModelRangeName( name, range );
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.