Package jimm.datavision.source

Examples of jimm.datavision.source.Column


    Report report = new Report();
    report.setDatabasePassword(DB_PASSWORD);
    report.read(EXAMPLE_REPORT);

    // Found because we try blank schema
    Column col = report.findColumn("jobs.ID");
    assertNotNull(col);
    assertEquals("public.jobs.ID", col.getId());

    // Found due to exact match
    col = report.findColumn("public.jobs.ID");
    assertNotNull(col);
    assertEquals("public.jobs.ID", col.getId());

    // Not found because schema doesn't match table's schema
    col = report.findColumn("dv_example.jobs.ID");
    assertNull(col);
}
View Full Code Here


        tagName = qName;

    if ("column".equals(tagName)) {
  String colName = attributes.getValue("name");
  int type = Column.typeFromString(attributes.getValue("type"));
  Column col = new Column(colName, colName, type);
  col.setDateParseFormat(attributes.getValue("date-format"));

  source.addColumn(col);
    }
}
View Full Code Here

}

public void findSelectablesUsed() {
    super.findSelectablesUsed();
    for (Iterator iter = charSepCols.iterator(); iter.hasNext(); ) {
  Column col = (Column)iter.next();
  if (!selectables.contains(col)) selectables.add(col);
    }
}
View Full Code Here

    String colId = colIdObj.toString();

    // First try a simple exact match using colCacheMap. This will often
    // fail the first time, but after we have found a column using the quite
    // convoluted search below we store the column in colCacheMap.
    Column col = (Column)colCacheMap.get(colId);
    if (col != null)
  return col;

    boolean caseSensitive =
  dataSource.getReport().caseSensitiveDatabaseNames();
View Full Code Here

    }

    int numColumnsInData = data.size();
    int i = 0;
    for (Iterator iter = source.columns(); iter.hasNext(); ++i) {
  Column col = (Column)iter.next();

  if (i >= numColumnsInData) {
      data.add(null);
      continue;
  }

  if (col.isNumeric()) {
      String str = data.get(i).toString();
      if (str == null || str.length() == 0)
    data.set(i, new Integer(0));
      else if (str.indexOf('.') == -1)
    data.set(i, new Integer(str));
      else
    data.set(i, new Double(str));
  }
  else if (col.isDate())
      data.set(i, parseDate(col, data.get(i).toString()));
  // else, it's a string; there is nothing to modify
    }

    return data;
View Full Code Here

TOP

Related Classes of jimm.datavision.source.Column

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.