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

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


   */
  static StringBuilder appendCellJson(TableCell cell,
      StringBuilder sb, boolean includeFormatting, boolean isLastColumn,
      boolean renderDateAsDateConstructor) {
    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();
    ULocale userLocale = dataTable.getLocaleForUserMessages();
    switch (aggregationType) {
      case COUNT: case MAX: case MIN: break;
      case AVG: case SUM:
      if (valueType != ValueType.NUMBER) {
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

   * @param sqlType The sql type to be converted.
   *
   * @return The value type that fits the given sql type.
   */
  private static ValueType sqlTypeToValueType(int sqlType) {
    ValueType valueType;
    switch (sqlType) {
      case Types.BOOLEAN:
      case Types.BIT: {
        valueType =  ValueType.BOOLEAN;
        break;
View Full Code Here

    DataTable table = new DataTable();
    table.addColumn(new ColumnDescription("dateCol", ValueType.DATE, "dateCol"));
     List<AbstractColumn> columns =
        Lists.newArrayList((AbstractColumn) new SimpleColumn("dateCol"));
     ScalarFunctionColumn sfc = new ScalarFunctionColumn(columns, scalarFunction);
    ValueType valueType = sfc.getValueType(table);
    assertEquals(ValueType.NUMBER, valueType);
  }
View Full Code Here

   * @param sqlType The sql type to be converted.
   *
   * @return The value type that fits the given sql type.
   */
  private static ValueType sqlTypeToValueType(int sqlType) {
    ValueType valueType;
    switch (sqlType) {
      case Types.BOOLEAN:
      case Types.BIT: {
        valueType =  ValueType.BOOLEAN;
        break;
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

     *                      of the column is taken.
     * @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

            trElement = document.createElement("tr");
            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);
                Element tdElement = document.createElement("td");
                if(cell.isNull()) {
                    tdElement.setTextContent("\u00a0");
                }
View Full Code Here

                else {
                    String value = cell.getValue().toString();
                    if(value == null) {
                        value = formatters.get(cell.getType()).format(cell.getValue());
                    }
                    ValueType type = cell.getType();
                    // Escape the string with quotes if its a text value or if it contains a comma.
                    if(value.indexOf(',') > -1 || type.equals(ValueType.TEXT)) {
                        sb.append(escapeString(value));
                    }
                    else {
                        sb.append(value);
                    }
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.