Package org.formulacompiler.compiler.internal

Examples of org.formulacompiler.compiler.internal.Duration


      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() );
      }
      else if (constantValue instanceof Number) {
        _stringBuilder.append( constantValue.toString() );
      }
      else if (constantValue instanceof String) {
View Full Code Here


            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 );
            final Duration duration = (Duration) constantValue;
            final long milliseconds = duration.getMilliseconds();
            final String dateValue = DataTypeUtil.durationToXmlFormat( milliseconds );
            attributes.put( XMLConstants.Office.TIME_VALUE, dateValue );
          }
          else if (constantValue instanceof Number) {
            attributes.put( XMLConstants.Office.VALUE_TYPE, ValueTypes.FLOAT );
View Full Code Here

      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() );
      }
      else if (constantValue instanceof Number) {
        _stringBuilder.append( constantValue.toString() );
      }
      else if (constantValue instanceof String) {
View Full Code Here

      if (null != this.globalTimeFormat
          && this.globalTimeFormat.equals( xlsDateCell.getCellFormat().getFormat().getFormatString() )) {
        value = RuntimeDouble_v2.dateFromNum( xlsDateCell.getValue(), this.globalTimeZone, ComputationMode.EXCEL );
      }
      else if (xlsDateCell.isTime()) {
        value = new Duration( xlsDateCell.getValue() );
      }
      else {
        value = new LocalDate( xlsDateCell.getValue() );
      }
      _rowBuilder.addCellWithConstant( value );
View Full Code Here

      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 );
    }
    else {
      final String stringValue;
      if (cellValue != null) {
        stringValue = cellValue;
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

TOP

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

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.