SEAGrid implements PlanetaryGrid { @Override public long getFirstBinIndex(int row) { return baseBin[row]; } SEAGrid();  SEAGrid(int numRows); static int computeRowCount(double res); @Override int getNumRows(); @Override int getNumCols(int row); @Override long getNumBins(); @Override long getFirstBinIndex(int row); @Override double getCenterLat(int row); @Override long getBinIndex(double lat, double lon); @Override int getRowIndex(long binIndex); @Override double[] getCenterLatLon(long binIndex); double getCenterLon(int row, int col); int getColIndex(double lon, int row); int getRowIndex(double lat); static final int DEFAULT_NUM_ROWS; static double RE; }
@Test public void testGetFirstBinIndex() { SEAGrid grid = new SEAGrid(6); try { grid.getFirstBinIndex(-1); fail("ArrayIndexOutOfBoundsException?"); } catch (ArrayIndexOutOfBoundsException e) { } assertEquals(0, grid.getFirstBinIndex(0)); assertEquals(3, grid.getFirstBinIndex(1)); assertEquals(3 + 8, grid.getFirstBinIndex(2)); assertEquals(3 + 8 + 12, grid.getFirstBinIndex(3)); assertEquals(3 + 8 + 12 + 12, grid.getFirstBinIndex(4)); assertEquals(3 + 8 + 12 + 12 + 8, grid.getFirstBinIndex(5)); try { grid.getFirstBinIndex(6); fail("ArrayIndexOutOfBoundsException?"); } catch (ArrayIndexOutOfBoundsException e) { } }