@Test public void testGeometryIndexOOB() { try { gcg.getCellGeometry(X_SIZE, 0); fail("expected IndexOutOfBoundsException on X index = X_SIZE"); } catch (IndexOutOfBoundsException e) { } try { gcg.getCellGeometry(-1, 0); fail("expected IndexOutOfBoundsException on X index = -1"); } catch (IndexOutOfBoundsException e) { } try { gcg.getCellGeometry(0, Y_SIZE); fail("expected IndexOutOfBoundsException on Y index = Y_SIZE"); } catch (IndexOutOfBoundsException e) { } try { gcg.getCellGeometry(0, -1); fail("expected IndexOutOfBoundsException on Y index = -1"); } catch (IndexOutOfBoundsException e) { } }
public Geometry getCellGeometry(int xIndex, int yIndex) { if (xIndex < 0 || xIndex >= xCellCount || yIndex < 0 || yIndex >= yCellCount) { throw new IndexOutOfBoundsException(); } return getCellGeometryQuick(xIndex, yIndex); }
GridCellGeometry { public Geometry getCellGeometry(int xIndex, int yIndex) { if (xIndex < 0 || xIndex >= xCellCount || yIndex < 0 || yIndex >= yCellCount) { throw new IndexOutOfBoundsException(); } return getCellGeometryQuick(xIndex, yIndex); } }
GridCellGeometry { public Geometry getCellGeometry(int xIndex, int yIndex) { if (xIndex < 0 || xIndex >= xCellCount || yIndex < 0 || yIndex >= yCellCount) { throw new IndexOutOfBoundsException(); } return getCellGeometryQuick(xIndex, yIndex); } GridCellGeometry(GridCoordSystem gridCoordSystem); }
GridCellGeometry { public Geometry getCellGeometry(int xIndex, int yIndex) { if (xIndex < 0 || xIndex >= xCellCount || yIndex < 0 || yIndex >= yCellCount) { throw new IndexOutOfBoundsException(); } return getCellGeometryQuick(xIndex, yIndex); } GridCellGeometry(GridCoordSystem gridCoordSystem); GridCoordSystem getGridCoordSystem(); CoordinateReferenceSystem getGridCRS(); int getCellCountX(); int getCellCountY(); int getCellCount(); Geometry getCellGeometry(int xIndex, int yIndex); final int calculateYXIndex(int xIndex, int yIndex); }
GridCellGeometry { public Geometry getCellGeometry(int xIndex, int yIndex) { if (xIndex < 0 || xIndex >= xCellCount || yIndex < 0 || yIndex >= yCellCount) { throw new IndexOutOfBoundsException(); } return getCellGeometryQuick(xIndex, yIndex); } GridCellGeometry(GridCoordSystem gridCoordSystem); GridCoordSystem getGridCoordSystem(); CoordinateReferenceSystem getGridCRS(); int getCellCountX(); int getCellCountY(); int getCellCount(); Geometry getCellGeometry(int xIndex, int yIndex); final int calculateYXIndex(int xIndex, int yIndex);  }