@Override @Deprecated public byte[] getRow() { return cell.getRow(); }
public CellRangeAddress getMergedRegionForCell(Cell c) { Sheet s = c.getRow().getSheet(); for (CellRangeAddress mergedRegion : s.getMergedRegions()) { if (mergedRegion.isInRange(c.getRowIndex(), c.getColumnIndex())) { // This region contains the cell in question return mergedRegion; } } // Not in any return null; }
/** * move (forward) in maze */ void move(Cell goodCell) { // set cell moving to as visited matrix[goodCell.getRow()][goodCell.getCol()].setIsVisited(true); // update current location in maze to cell moving setCurrent(goodCell); // store cell moved to in stack (solution path) path.push(goodCell); }
private int maxSequence (char player, Cell c) { int row = c.getRow(); int col = c.getCol(); int maxVert = 0; int maxHor = 0; int maxDiag = 0; for (int j = 0; j < _board[0].length; j++) { if ((board [col] [row+j] == player) || (board [col] [row-j] == player)) maxVert++; if ((board [col+j][row] == player) || (board [col-j][row] == player)) maxHor++; if ((board [col+j][row+j] == player) || (board [col-j][row-j] == player)) maxDiag++; } return Math.max (maxHor, Math.max (maxVert, maxDiag)); }
public String getData(String SheetName, String DataSet, String ColumnName) throws JXLException, IOException { Workbook workbook = Workbook.getWorkbook(new File( ".\\data\\TestData.xls")); Sheet sheet = workbook.getSheet(SheetName); Cell sTestData = sheet.findCell(DataSet); int iNumCol = sheet.getColumns(); int iRow = sTestData.getRow(); boolean bColumnFound = false; int iCol; for (int p = 0; p < iNumCol; p++) { String sCol = sheet.getCell(p, 0).getContents(); if (sCol.matches(ColumnName)) { iCol = p; bColumnFound = true; } } if (!bColumnFound) { return ""; } return sheet.getCell(iCol, iRow).getContents(); }
/** * is valid move */ bool isValidMove(Cell toCell) { int row = toCell.getRow(); int col = toCell.getCol(); // check if within bounds of maze if ((row >= 0 && row < rows) && (col >= 0 && col < cols)) { // if not a wall if (!matrix[row][col].getIsWall()) { // if not a bad path if (!matrix[row][col].getIsBadPath()) { return true; } } } return false; }
for (Row r : sheet) { for (Cell c : r) { int columnNumber = c.getColumnIndex(); int rowNumber = c.getRow().getRowNum(); CellReference cr = new CellReference(c); System.out.println("Cell at " + rowNum + "," + columnNumber + " found, that's " + cr.formatAsString()); } }
private int maxSequence (char player , Cell c) { int row = c.getRow(); int col = c.getCol(); int maxVert = 0; int maxHor = 0; int maxDiag = 0; for (int j = 0; j < _board[0].length; j++) { if ( (_board[col][row+j] == O) || (_board[col][row-j] == player) ) { maxVert++; } if ( (_board[col+j][row] == O) || (_board[col-j][row] == player) ) { maxHor++; } if ( (_board[col+j][row+j] == 0) || (_board[col-j][row-j] == player) ) { maxDiag++; } } return Math.max(maxDiag, Math.max(maxVert, maxHor)); }
@Override public int compare(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) { // BytesWritable and KeyValue each serialize 4 bytes to indicate length if (llength < 8) { throw new AssertionError("Too small llength: " + llength); } if (rlength < 8) { throw new AssertionError("Too small rlength: " + rlength); } Cell leftKey = new KeyValue(left, loffset + 8, llength - 8); Cell rightKey = new KeyValue(right, roffset + 8, rlength - 8); byte[] lRow = leftKey.getRow(); byte[] rRow = rightKey.getRow(); int rowCmp = Bytes.compareTo(lRow, rRow); if (rowCmp != 0) { return rowCmp; } else { return KeyValue.COMPARATOR.compare(leftKey, rightKey); } }
service.getFeed(cellFeedUrl, CellFeed.class); for(CellEntry ce : cellFeed.getEntries()) { Cell cell = ce.getCell(); if(cell.getRow() == 1 && cell.getCol() == 3) { System.out.println(cell.getDoubleValue()); } }
private void collectRow() { rowSizeBytes.update(curRowBytes); rowSizeCols.update(curRowCols); keyLen.update(curRowKeyLength); if (curRowBytes > maxRowBytes && prevCell != null) { biggestRow = prevCell.getRow(); maxRowBytes = curRowBytes; } curRowBytes = 0; curRowCols = 0; }
@Override public void append(RegionEntryBuffer buffer) throws IOException { List<Entry> entries = buffer.getEntryBuffer(); if (entries.isEmpty() || entries.get(0).getEdit().getCells().isEmpty()) { return; } // meta edits (e.g. flush) are always replicated. // data edits (e.g. put) are replicated if the table requires them. if (!requiresReplication(buffer.getTableName(), entries)) { return; } sinkWriter.append(buffer.getTableName(), buffer.getEncodedRegionName(), entries.get(0).getEdit().getCells().get(0).getRow(), entries); }
@Override public void assertColumn(HTable table, byte[] row, byte[] col, long expected) throws Exception { Result res = table.get(new Get(row)); Cell resA = res.getColumnLatestCell(FAMILY, col); assertFalse(res.isEmpty()); assertNotNull(resA); assertEquals(expected, Bytes.toLong(resA.getValue())); Scan scan = new Scan(row); scan.addFamily(FAMILY); ResultScanner scanner = table.getScanner(scan); Result scanRes = scanner.next(); assertNotNull(scanRes); assertFalse(scanRes.isEmpty()); Cell scanResA = scanRes.getColumnLatestCell(FAMILY, col); assertArrayEquals(row, scanResA.getRow()); assertEquals(expected, Bytes.toLong(scanResA.getValue())); }
@Override public void assertColumn(HTable table, byte[] row, byte[] col, long expected) throws Exception { Result res = table.get(new Get(row)); Cell resA = res.getColumnLatestCell(FAMILY, col); assertFalse(res.isEmpty()); assertNotNull(resA); assertEquals(expected, Bytes.toLong(resA.getValue())); Scan scan = new Scan(row); scan.addFamily(FAMILY); ResultScanner scanner = table.getScanner(scan); Result scanRes = scanner.next(); assertNotNull(scanRes); assertFalse(scanRes.isEmpty()); Cell scanResA = scanRes.getColumnLatestCell(FAMILY, col); assertArrayEquals(row, scanResA.getRow()); assertEquals(expected, Bytes.toLong(scanResA.getValue())); }
@Override public void assertColumn(HTable table, byte[] row, byte[] col, long expected) throws Exception { Result res = table.get(new Get(row)); Cell resA = res.getColumnLatestCell(FAMILY, col); assertFalse(res.isEmpty()); assertNotNull(resA); assertEquals(expected, Bytes.toLong(resA.getValue())); Scan scan = new Scan(row); scan.addFamily(FAMILY); ResultScanner scanner = table.getScanner(scan); Result scanRes = scanner.next(); assertNotNull(scanRes); assertFalse(scanRes.isEmpty()); Cell scanResA = scanRes.getColumnLatestCell(FAMILY, col); assertArrayEquals(row, scanResA.getRow()); assertEquals(expected, Bytes.toLong(scanResA.getValue())); }
@Override public void assertColumn(HTable table, byte[] row, byte[] col, long expected) throws Exception { Result res = table.get(new Get(row)); Cell resA = res.getColumnLatestCell(FAMILY, col); assertFalse(res.isEmpty()); assertNotNull(resA); assertEquals(expected, Bytes.toLong(resA.getValue())); Scan scan = new Scan(row); scan.addFamily(FAMILY); ResultScanner scanner = table.getScanner(scan); Result scanRes = scanner.next(); assertNotNull(scanRes); assertFalse(scanRes.isEmpty()); Cell scanResA = scanRes.getColumnLatestCell(FAMILY, col); assertArrayEquals(row, scanResA.getRow()); assertEquals(expected, Bytes.toLong(scanResA.getValue())); }
@Override public void assertColumn(HTable table, byte[] row, byte[] col, long expected) throws Exception { Result res = table.get(new Get(row)); Cell resA = res.getColumnLatestCell(FAMILY, col); assertFalse(res.isEmpty()); assertNotNull(resA); assertEquals(expected, Bytes.toLong(resA.getValue())); Scan scan = new Scan(row); scan.addFamily(FAMILY); ResultScanner scanner = table.getScanner(scan); Result scanRes = scanner.next(); assertNotNull(scanRes); assertFalse(scanRes.isEmpty()); Cell scanResA = scanRes.getColumnLatestCell(FAMILY, col); assertArrayEquals(row, scanResA.getRow()); assertEquals(expected, Bytes.toLong(scanResA.getValue())); }
@Override public void assertColumn(HTable table, byte[] row, byte[] col, long expected) throws Exception { Result res = table.get(new Get(row)); Cell resA = res.getColumnLatestCell(FAMILY, col); assertFalse(res.isEmpty()); assertNotNull(resA); assertEquals(expected, Bytes.toLong(resA.getValue())); Scan scan = new Scan(row); scan.addFamily(FAMILY); ResultScanner scanner = table.getScanner(scan); Result scanRes = scanner.next(); assertNotNull(scanRes); assertFalse(scanRes.isEmpty()); Cell scanResA = scanRes.getColumnLatestCell(FAMILY, col); assertArrayEquals(row, scanResA.getRow()); assertEquals(expected, Bytes.toLong(scanResA.getValue())); }
@Override public void assertColumn(HTable table, byte[] row, byte[] col, long expected) throws Exception { Result res = table.get(new Get(row)); Cell resA = res.getColumnLatestCell(FAMILY, col); assertFalse(res.isEmpty()); assertNotNull(resA); assertEquals(expected, Bytes.toLong(resA.getValue())); Scan scan = new Scan(row); scan.addFamily(FAMILY); ResultScanner scanner = table.getScanner(scan); Result scanRes = scanner.next(); assertNotNull(scanRes); assertFalse(scanRes.isEmpty()); Cell scanResA = scanRes.getColumnLatestCell(FAMILY, col); assertArrayEquals(row, scanResA.getRow()); assertEquals(expected, Bytes.toLong(scanResA.getValue())); }