SmosDgg { static int seqnumToGridPointId(int seqnum) { return seqnum <= C ? seqnum : seqnum == MAX_SEQNUM ? MAX_GRID_POINT_ID : seqnum - 1 + ((seqnum - 2) / B) * D; } private  SmosDgg(); static SmosDgg getInstance(); static int gridPointIdToSeqnum(int gridPointId); static int seqnumToSeqnumInZone(int seqnum); static int seqnumToZoneId(int seqnum); AffineTransform getImageToMapTransform(); MultiLevelImage getMultiLevelImage(); static final int MIN_GRID_POINT_ID; static final int MAX_GRID_POINT_ID; static final int MAX_SEQNUM; static final int MAX_ZONE_ID; }
@Test public void seqnumToGridPointId() { assertEquals(1, SmosDgg.seqnumToGridPointId(1)); assertEquals(2, SmosDgg.seqnumToGridPointId(2)); assertEquals(3, SmosDgg.seqnumToGridPointId(3)); assertEquals(262144, SmosDgg.seqnumToGridPointId(262144)); assertEquals(262145, SmosDgg.seqnumToGridPointId(262145)); assertEquals(1000001, SmosDgg.seqnumToGridPointId(262146)); assertEquals(1000002, SmosDgg.seqnumToGridPointId(262147)); assertEquals(1262143, SmosDgg.seqnumToGridPointId(524288)); assertEquals(1262144, SmosDgg.seqnumToGridPointId(524289)); assertEquals(2000001, SmosDgg.seqnumToGridPointId(524290)); assertEquals(2000002, SmosDgg.seqnumToGridPointId(524291)); assertEquals(8262143, SmosDgg.seqnumToGridPointId(2359296)); assertEquals(8262144, SmosDgg.seqnumToGridPointId(2359297)); assertEquals(9000001, SmosDgg.seqnumToGridPointId(2359298)); assertEquals(9000002, SmosDgg.seqnumToGridPointId(2359299)); assertEquals(9262144, SmosDgg.seqnumToGridPointId(2621441)); assertEquals(9262145, SmosDgg.seqnumToGridPointId(2621442)); }