com.healthmarketscience.jackcess.Table.getColumnCount()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(579)

本文整理了Java中com.healthmarketscience.jackcess.Table.getColumnCount()方法的一些代码示例,展示了Table.getColumnCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getColumnCount()方法的具体详情如下:
包路径:com.healthmarketscience.jackcess.Table
类名称:Table
方法名:getColumnCount

Table.getColumnCount介绍

暂无

代码示例

代码示例来源:origin: com.healthmarketscience.jackcess/jackcess

  1. private Object[] newRowArray() {
  2. Object[] row = new Object[_flatTable.getColumnCount() + 1];
  3. row[row.length - 1] = ColumnImpl.RETURN_ROW_ID;
  4. return row;
  5. }

代码示例来源:origin: net.sf.ucanaccess/ucanaccess

  1. @Override
  2. public int getColumnCount() {
  3. return wrapped.getColumnCount();
  4. }

代码示例来源:origin: ujmp/universal-java-matrix-package

  1. public long[] getSize() {
  2. size[ROW] = table.getRowCount();
  3. size[COLUMN] = table.getColumnCount();
  4. return size;
  5. }

代码示例来源:origin: com.healthmarketscience.jackcess/jackcess

  1. private static void nullSecondaryValues(Joiner joiner, Object[] oldFromRow)
  2. throws IOException
  3. {
  4. IndexCursor toCursor = joiner.getToCursor();
  5. List<? extends Index.Column> fromCols = joiner.getColumns();
  6. List<? extends Index.Column> toCols = joiner.getToIndex().getColumns();
  7. Object[] toRow = new Object[joiner.getToTable().getColumnCount()];
  8. for(Iterator<Row> iter = joiner.findRows(oldFromRow)
  9. .setColumnNames(Collections.<String>emptySet())
  10. .iterator(); iter.hasNext(); ) {
  11. iter.next();
  12. // create update row for "to" table
  13. Arrays.fill(toRow, Column.KEEP_VALUE);
  14. for(int i = 0; i < fromCols.size(); ++i) {
  15. toCols.get(i).getColumn().setRowValue(toRow, null);
  16. }
  17. toCursor.updateCurrentRow(toRow);
  18. }
  19. }

代码示例来源:origin: com.healthmarketscience.jackcess/jackcess

  1. private static void updateSecondaryValues(Joiner joiner, Object[] oldFromRow,
  2. Object[] newFromRow)
  3. throws IOException
  4. {
  5. IndexCursor toCursor = joiner.getToCursor();
  6. List<? extends Index.Column> fromCols = joiner.getColumns();
  7. List<? extends Index.Column> toCols = joiner.getToIndex().getColumns();
  8. Object[] toRow = new Object[joiner.getToTable().getColumnCount()];
  9. for(Iterator<Row> iter = joiner.findRows(oldFromRow)
  10. .setColumnNames(Collections.<String>emptySet())
  11. .iterator(); iter.hasNext(); ) {
  12. iter.next();
  13. // create update row for "to" table
  14. Arrays.fill(toRow, Column.KEEP_VALUE);
  15. for(int i = 0; i < fromCols.size(); ++i) {
  16. Object val = fromCols.get(i).getColumn().getRowValue(newFromRow);
  17. toCols.get(i).getColumn().setRowValue(toRow, val);
  18. }
  19. toCursor.updateCurrentRow(toRow);
  20. }
  21. }

代码示例来源:origin: AccelerationNet/access2csv

  1. static int export(Database db, String tableName, Writer csv, boolean withHeader, boolean applyQuotesToAll, String nullText) throws IOException{
  2. Table table = db.getTable(tableName);
  3. String[] buffer = new String[table.getColumnCount()];
  4. CSVWriter writer = new CSVWriter(new BufferedWriter(csv), CSVWriter.DEFAULT_SEPARATOR, CSVWriter.DEFAULT_QUOTE_CHARACTER);
  5. int rows = 0;
  6. try{
  7. if (withHeader) {
  8. int x = 0;
  9. for(Column col : table.getColumns()){
  10. buffer[x++] = col.getName();
  11. }
  12. writer.writeNext(buffer, applyQuotesToAll);
  13. }
  14. for(Row row : table){
  15. int i = 0;
  16. for (Object object : row.values()) {
  17. buffer[i++] = object == null ? nullText : object.toString();
  18. }
  19. writer.writeNext(buffer, applyQuotesToAll);
  20. rows++;
  21. }
  22. }finally{
  23. writer.close();
  24. }
  25. return rows;
  26. }

代码示例来源:origin: com.healthmarketscience.jackcess/jackcess

  1. int numColumns = table.getColumnCount();

相关文章