Package com.google.gdata.client.spreadsheet

Examples of com.google.gdata.client.spreadsheet.CellQuery


            int minRow = startRow;
            int maxRow = Math.min(worksheet.getRowCount(), startRow + rowCount - 1);
            int cols = worksheet.getColCount();
            int rows = worksheet.getRowCount();
           
            CellQuery cellQuery = new CellQuery(cellFeedUrl);
            cellQuery.setMinimumRow(minRow);
            cellQuery.setMaximumRow(maxRow);
            cellQuery.setMaximumCol(cols);
            cellQuery.setMaxResults(rows * cols);
            cellQuery.setReturnEmpty(false);
           
            CellFeed cellFeed = service.query(cellQuery, CellFeed.class);
            List<CellEntry> cellEntries = cellFeed.getEntries();
           
            List<List<Object>> rowsOfCells = new ArrayList<List<Object>>(rowCount);
View Full Code Here


       
        final URL cellFeedUrl = worksheetEntry.getCellFeedUrl();
        final CellEntry[][] cellEntries =
            new CellEntry[worksheetEntry.getRowCount()][worksheetEntry.getColCount()];
        {
            CellQuery cellQuery = new CellQuery(cellFeedUrl);
            cellQuery.setReturnEmpty(true);
           
            CellFeed fetchingCellFeed = service.getFeed(cellQuery, CellFeed.class);
            for (CellEntry cellEntry : fetchingCellFeed.getEntries()) {
              Cell cell = cellEntry.getCell();
              cellEntries[cell.getRow() - 1][cell.getCol() - 1] = cellEntry;
View Full Code Here

    final int colCount = workSheet.getColCount();
    String[] columnTitle = new String[colCount];
    String[] dataType = new String[colCount];

    URL cellFeedUrl = workSheet.getCellFeedUrl();
    CellQuery query = new CellQuery(cellFeedUrl);

    // Title & Type
    query.setMinimumRow(1);
    query.setMaximumRow(2);
    CellFeed feed = ss.query(query, CellFeed.class);
    for (CellEntry cell : feed.getEntries()) {
      final String shortId = cell.getId().substring(cell.getId().lastIndexOf('/') + 1);
      logger.fine(shortId + ":" + cell.getCell().getValue());
      int row = Integer.parseInt(shortId.substring(1, shortId.lastIndexOf('C')));
      int col = Integer.parseInt(shortId.substring(shortId.lastIndexOf('C') + 1));
      if (row == 1) {
        columnTitle[col - 1] = cell.getCell().getValue();
      } else {
        dataType[col - 1] = cell.getCell().getValue();
      }
    }

    // Data (start from line no.3)
    query.setMinimumRow(startIndex);
    final int nextMax = startIndex + maxRows - 1;
    final int maxRowCount = workSheet.getRowCount();
    final int maxRow = (nextMax > maxRowCount) ? maxRowCount : nextMax;
    logger.fine(startIndex + "〜" + maxRow);
    if (startIndex >= maxRow) {
      return null;
    }
    query.setMaximumRow(maxRow);
    feed = ss.query(query, CellFeed.class);
    GbEntity gbEntity = null;
    List<GbEntity> data = new ArrayList<GbEntity>();
    for (CellEntry cell : feed.getEntries()) {
      final String shortId = cell.getId().substring(cell.getId().lastIndexOf('/') + 1);
View Full Code Here

    /**
     * Presents the given cell feed as a map from row, column pair to CellEntry.
     */
    private void refreshCachedData() throws IOException, ServiceException {

      CellQuery cellQuery = new CellQuery(backingEntry.getCellFeedUrl());
      cellQuery.setReturnEmpty(true);
      this.cellFeed = spreadsheetService.getFeed(cellQuery, CellFeed.class);

      // A subtlety: Spreadsheets row,col numbers are 1-based whereas the
      // cellEntries array is 0-based. Rather than wasting an extra row and
      // column worth of cells in memory, we adjust accesses by subtracting
View Full Code Here

TOP

Related Classes of com.google.gdata.client.spreadsheet.CellQuery

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.