Package org.formulacompiler.compiler.internal

Examples of org.formulacompiler.compiler.internal.LocalDate


      }
      else if (constantValue instanceof Date) {
        throw new IllegalArgumentException( "Saving dates is not supported." );
      }
      else if (constantValue instanceof LocalDate) {
        final LocalDate localDate = (LocalDate) constantValue;
        _stringBuilder.append( localDate.doubleValue() );
      }
      else if (constantValue instanceof Duration) {
        final Duration duration = (Duration) constantValue;
        _stringBuilder.append( duration.doubleValue() );
      }
View Full Code Here


            final String dateValue = DataTypeUtil.dateToXmlFormat( (Date) constantValue, this.timeZone );
            attributes.put( XMLConstants.Office.DATE_VALUE, dateValue );
          }
          else if (constantValue instanceof LocalDate) {
            attributes.put( XMLConstants.Office.VALUE_TYPE, ValueTypes.DATE );
            final LocalDate localDate = (LocalDate) constantValue;
            final Date date = RuntimeDouble_v2.dateFromNum( localDate.doubleValue(), DataTypeUtil.GMT_TIME_ZONE, ComputationMode.OPEN_OFFICE_CALC );
            final String dateValue = DataTypeUtil.dateToXmlFormat( date, DataTypeUtil.GMT_TIME_ZONE );
            attributes.put( XMLConstants.Office.DATE_VALUE, dateValue );
          }
          else if (constantValue instanceof Duration) {
            attributes.put( XMLConstants.Office.VALUE_TYPE, ValueTypes.TIME );
View Full Code Here

      }
      else if (constantValue instanceof Date) {
        throw new IllegalArgumentException( "Saving dates is not supported." );
      }
      else if (constantValue instanceof LocalDate) {
        final LocalDate localDate = (LocalDate) constantValue;
        _stringBuilder.append( localDate.doubleValue() );
      }
      else if (constantValue instanceof Duration) {
        final Duration duration = (Duration) constantValue;
        _stringBuilder.append( duration.doubleValue() );
      }
View Full Code Here

      }
      else if (xlsDateCell.isTime()) {
        value = new Duration( xlsDateCell.getValue() );
      }
      else {
        value = new LocalDate( xlsDateCell.getValue() );
      }
      _rowBuilder.addCellWithConstant( value );
    }
    else if (jxl.CellType.LABEL == xlsType) {
      _rowBuilder.addCellWithConstant( ((jxl.LabelCell) _xlsCell).getString() );
View Full Code Here

      return value;

    final Style cellStyle = this.stylesheet.getStyle( Integer.parseInt( _styleIndex.getValue() ) );
    if (cellStyle != null) {
      if (!cellStyle.isDate() && cellStyle.isTime())
        return value < 365.0 ? new Duration( value ) : new LocalDate( value );

      if (cellStyle.isDate())
        //LATER: need to check for global time format & global timezone
        return value < 1.0 ? new Duration( value ) : new LocalDate( value );
    }
    return value;
  }
View Full Code Here

      value = Boolean.valueOf( this.tableCell.booleanValue );
    }
    else if (ValueTypes.DATE.equals( cellValueType )) {
      final Date date = DataTypeUtil.dateFromXmlFormat( this.tableCell.dateValue, DataTypeUtil.GMT_TIME_ZONE );
      final double dateNum = RuntimeDouble_v2.dateToNum( date, DataTypeUtil.GMT_TIME_ZONE, ComputationMode.OPEN_OFFICE_CALC );
      value = new LocalDate( dateNum );
    }
    else if (ValueTypes.TIME.equals( cellValueType )) {
      final long durationInMillis = DataTypeUtil.durationFromXmlFormat( this.tableCell.timeValue );
      value = new Duration( durationInMillis );
    }
View Full Code Here

TOP

Related Classes of org.formulacompiler.compiler.internal.LocalDate

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.