@Test public void testParseTileCode() { String relativeUrl = "12/5/7.jpg"; TileCode tc = TileMapUrlBuilder.parseTileCode(relativeUrl); Assert.assertNotNull(tc); Assert.assertTrue(tc.getTileLevel() == 12); Assert.assertTrue(tc.getX() == 5); Assert.assertTrue(tc.getY() == 7); }
public static TileCode parseTileCode(String relativeUrl) { TileCode tc = new TileCode(); StringTokenizer tokenizer = new StringTokenizer(relativeUrl, "/"); tc.setTileLevel(Integer.parseInt(tokenizer.nextToken())); tc.setX(Integer.parseInt(tokenizer.nextToken())); tc.setY(Integer.parseInt(tokenizer.nextToken().split("\\.")[0])); return tc; }
TileMapUrlBuilder implements TileUrlBuilder { public static TileCode parseTileCode(String relativeUrl) { TileCode tc = new TileCode(); StringTokenizer tokenizer = new StringTokenizer(relativeUrl, "/"); tc.setTileLevel(Integer.parseInt(tokenizer.nextToken())); tc.setX(Integer.parseInt(tokenizer.nextToken())); tc.setY(Integer.parseInt(tokenizer.nextToken().split("\\.")[0])); return tc; } }
TileMapUrlBuilder implements TileUrlBuilder { public static TileCode parseTileCode(String relativeUrl) { TileCode tc = new TileCode(); StringTokenizer tokenizer = new StringTokenizer(relativeUrl, "/"); tc.setTileLevel(Integer.parseInt(tokenizer.nextToken())); tc.setX(Integer.parseInt(tokenizer.nextToken())); tc.setY(Integer.parseInt(tokenizer.nextToken().split("\\.")[0])); return tc; } TileMapUrlBuilder(TileMap tileMap); }
TileMapUrlBuilder implements TileUrlBuilder { public static TileCode parseTileCode(String relativeUrl) { TileCode tc = new TileCode(); StringTokenizer tokenizer = new StringTokenizer(relativeUrl, "/"); tc.setTileLevel(Integer.parseInt(tokenizer.nextToken())); tc.setX(Integer.parseInt(tokenizer.nextToken())); tc.setY(Integer.parseInt(tokenizer.nextToken().split("\\.")[0])); return tc; } TileMapUrlBuilder(TileMap tileMap); @Override String buildUrl(TileCode tileCode, String baseTmsUrl); static String resolveProxyUrl(String relativeUrl, TileMap tileMap, String baseTmsUrl); static TileCode parseTileCode(String relativeUrl); }
TileMapUrlBuilder implements TileUrlBuilder { public static TileCode parseTileCode(String relativeUrl) { TileCode tc = new TileCode(); StringTokenizer tokenizer = new StringTokenizer(relativeUrl, "/"); tc.setTileLevel(Integer.parseInt(tokenizer.nextToken())); tc.setX(Integer.parseInt(tokenizer.nextToken())); tc.setY(Integer.parseInt(tokenizer.nextToken().split("\\.")[0])); return tc; } TileMapUrlBuilder(TileMap tileMap); @Override String buildUrl(TileCode tileCode, String baseTmsUrl); static String resolveProxyUrl(String relativeUrl, TileMap tileMap, String baseTmsUrl); static TileCode parseTileCode(String relativeUrl);  }