Package com.google.visualization.datasource.datatable.value

Examples of com.google.visualization.datasource.datatable.value.TimeOfDayValue


                    gc.set(1970, Calendar.JANUARY, 1, time.getHours(), time.getMinutes(),
                            time.getSeconds());
                    // Set the milliseconds explicitly, otherwise the milliseconds from
                    // the time the gc was initialized are used.
                    gc.set(GregorianCalendar.MILLISECOND, 0);
                    value = new TimeOfDayValue(gc);
                }
                break;
            default:
                String colValue = rs.getString(column);
                if(colValue == null) {
View Full Code Here


                case DATE: {
                    dateTimeValue = new DateValue(rowTime.getYear(), rowTime.getMonthOfYear()-1, rowTime.getDayOfMonth());
                    break;
                }
                case TIMEOFDAY: {
                    dateTimeValue = new TimeOfDayValue(rowTime.getHourOfDay(), rowTime.getMinuteOfHour(), 0);
                    break;
                }
                default: {
                    dateTimeValue = new DateTimeValue(rowTime.getYear(), rowTime.getMonthOfYear()-1, rowTime.getDayOfMonth(), rowTime.getHourOfDay(), rowTime.getMinuteOfHour(), 0, 0);
                    break;
View Full Code Here

    String escapedFormattedString = "";
    boolean isJsonNull = false;

    // Prepare a Json string representing the current value.
    DateValue dateValue;
    TimeOfDayValue timeOfDayValue;
    if ((value == null) || (value.isNull())) {
      valueJson.append("null");
      isJsonNull = true;
    } else {
      switch (type) {
        case BOOLEAN:
          valueJson.append(((BooleanValue) value).getValue());
          break;
        case DATE:
          valueJson.append("new Date(");
          dateValue = (DateValue) value;
          valueJson.append(dateValue.getYear()).append(",");
          valueJson.append(dateValue.getMonth()).append(",");
          valueJson.append(dateValue.getDayOfMonth());
          valueJson.append(")");
          break;
        case NUMBER:
          valueJson.append(((NumberValue) value).getValue());
          break;
        case TEXT:
          valueJson.append("'");
          valueJson.append(EscapeUtil.jsonEscape(value.toString()));
          valueJson.append("'");
          break;
        case TIMEOFDAY:
          valueJson.append("[");
          timeOfDayValue = (TimeOfDayValue) value;
          valueJson.append(timeOfDayValue.getHours()).append(",");
          valueJson.append(timeOfDayValue.getMinutes()).append(",");
          valueJson.append(timeOfDayValue.getSeconds()).append(",");
          valueJson.append(timeOfDayValue.getMilliseconds());
          valueJson.append("]");
          break;
        case DATETIME:
          calendar = ((DateTimeValue) value).getCalendar();
          valueJson.append("new Date(");
View Full Code Here

          log.error(String.format(timeOfDayMessage, s));
          throw new InvalidQueryException(String.format(timeOfDayMessage, s));
        }
        second = Integer.parseInt(secondMilliSplit[0]);
        int milli = Integer.parseInt(secondMilliSplit[1]);
        return new TimeOfDayValue(hour, minute, second, milli);
      } else {
        second = Integer.parseInt(split[2]);
        return new TimeOfDayValue(hour, minute, second);
      }
    } catch (NumberFormatException e) {
      log.error(String.format(timeOfDayMessage, s));
      throw new InvalidQueryException(String.format(timeOfDayMessage, s));
    } catch (IllegalArgumentException e) {
View Full Code Here

          uFormat.format(new DateValue(1995, 7, 3).getObjectToFormat());
          break;
        case TIMEOFDAY:
          uFormat = new SimpleDateFormat(pattern, locale);
          ((SimpleDateFormat) uFormat).setTimeZone(TimeZone.getTimeZone("GMT"));
          uFormat.format(new TimeOfDayValue(2, 59, 12, 123).getObjectToFormat());
          break;
        case DATETIME:
          uFormat = new SimpleDateFormat(pattern, locale);
          ((SimpleDateFormat) uFormat).setTimeZone(TimeZone.getTimeZone("GMT"));
          uFormat.format(new DateTimeValue(1995, 7, 3, 2, 59, 12, 123).getObjectToFormat());
View Full Code Here

   */
  private TimeOfDayValue parseTimeOfDay(String val) throws ParseException {
    Date date = ((SimpleDateFormat) uFormat).parse(val);
    GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
    gc.setTime(date);
    return new TimeOfDayValue(gc);
  }
View Full Code Here

  private static TimeOfDayValue parseTimeOfDay(String val, DateFormat format)
      throws ParseException {
    Date date = format.parse(val);
    GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
    gc.setTime(date);
    return new TimeOfDayValue(gc);
  }
View Full Code Here

TOP

Related Classes of com.google.visualization.datasource.datatable.value.TimeOfDayValue

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.