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

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


   * @return The input string builder.
   */
  public static StringBuilder appendCellJson(TableCell cell,
      StringBuilder sb, boolean includeFormatting, boolean isLastColumn) {
    Value value = cell.getValue();
    ValueType type = cell.getType();
    StringBuilder valueJson = new StringBuilder();
    GregorianCalendar calendar;
    String escapedFormattedString = "";
    boolean isJsonNull = false;

View Full Code Here


   *
   * @throws InvalidQueryException Thrown if the column is invalid.
   */
  @Override
  public void validateColumn(DataTable dataTable) throws InvalidQueryException {
    ValueType valueType = dataTable.getColumnDescription(aggregatedColumn.getId()).getType();
    switch (aggregationType) {
      case COUNT: case MAX: case MIN: break;
      case AVG: case SUM:
      if (valueType != ValueType.NUMBER) {
        throw new InvalidQueryException("'Average' and 'sum' aggreagation "
View Full Code Here

   *
   * @return The value type of the column.
   */
  @Override
  public ValueType getValueType(DataTable dataTable) {
    ValueType valueType;
    ValueType originalValueType =
        dataTable.getColumnDescription(aggregatedColumn.getId()).getType();
    switch (aggregationType) {
      case COUNT:
        valueType = ValueType.NUMBER;
        break;
View Full Code Here

      String backgroundColor = (rowCount % 2 != 0) ? "#f0f0f0" : "#ffffff";
      trElement.setAttribute("style", "background-color: " + backgroundColor);

      List<TableCell> cells = row.getCells();
      for (int c = 0; c < cells.size(); c++) {
        ValueType valueType = columnDescriptions.get(c).getType();
        TableCell cell = cells.get(c);
        String cellFormattedText = cell.getFormattedValue();
        if (cellFormattedText == null) {
          cellFormattedText = formatters.get(cell.getType()).format(cell.getValue());
        }
View Full Code Here

   */
  /* package */ ColumnDescription createAggregationColumnDescription(
      ColumnDescription originalColumnDescription) {
    AggregationType aggregationType = aggregation.getAggregationType();
    String columnId = createIdPivotPrefix() + aggregation.getId();
    ValueType type = originalColumnDescription.getType();
    String aggregationLabelPart = aggregation.getAggregationType().getCode()
        + " " + originalColumnDescription.getLabel();
    String pivotLabelPart = createLabelPivotPart();
    String label;
    if (isPivot()) {
View Full Code Here

   *
   * @return The ColumnDescription for this column.
   */
  public ColumnDescription createColumnDescription(DataTable originalTable) {
    String columnId = createIdPivotPrefix() + scalarFunctionColumn.getId();
    ValueType type = scalarFunctionColumn.getValueType(originalTable);
    String label = createLabelPivotPart() + " " +
        getColumnDescriptionLabel(originalTable, scalarFunctionColumn);
    ColumnDescription result = new ColumnDescription(columnId, type, label);

    return result;
View Full Code Here

   * @return Value with the timeComponent value of the given value, or number
   *     null value if value is null.
   */
  public Value evaluate(List<Value> values) {
    Value value = values.get(0);
    ValueType valueType = value.getType();
    int component;

    // If the value is null, return a null number value.
    if (value.isNull()) {
      return NumberValue.getNullValue();
View Full Code Here

    for (Map<String, Object> entry : getPropertyMapForFeed(dataFeed)) {
      TableRow row = new TableRow();
      try {
        for (ColumnDescription description : columnDescriptions) {
          String columnId = description.getId();
          ValueType valueType = description.getType();
          Object oValue = getEntryValue(entry, columnId);
          if (oValue != null) {
            Value value = GVizTypeConverter.getValue(valueType, oValue);
            row.addCell(value);
          } else {
View Full Code Here

      //logger.log(Level.SEVERE, "unknown or missing property - " + id);
      throw new FeedServerAdapterException
      (FeedServerAdapterException.Reason.BAD_FEED_TYPE_CONFIG,
          "unknown or missing property - " + id);
    }
    ValueType valueType = GVizTypeConverter.getValueType(typeName);
    return new ColumnDescription(id, valueType, label);   
  }
View Full Code Here

TOP

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

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.