@Test public void testGetIds() { double longitude = 0.1; double latitude = 0.1; XYGridTree instance = new XYGridTree(4); Iterator<CellId> result = instance.getIds(longitude, latitude).iterator(); Set<CellId> cellIds = Sets.newHashSet(result); assertEquals(5, cellIds.size()); assertTrue(cellIds.contains(new CellId(0,0L))); assertTrue(cellIds.contains(new CellId(1,1L))); assertTrue(cellIds.contains(new CellId(2,6L))); assertTrue(cellIds.contains(new CellId(3,20L))); assertTrue(cellIds.contains(new CellId(4,72L))); }
@SuppressWarnings("Convert2Lambda") public Iterable<CellId> getIds(long longitude, long latitude) { return new Iterable<CellId>() { @Override public Iterator<CellId> iterator() { Iterator<CellId> result = new Iterator<CellId>() { private int level = -1; @Override public boolean hasNext() { return level < maxLevel; } @Override public CellId next() { level++; return new CellId(gridMap.get(level).getLevel(), gridMap.get(level).getId(longitude, latitude)); } }; return result; } }; }
XYGridTree implements Serializable { @SuppressWarnings("Convert2Lambda") public Iterable<CellId> getIds(long longitude, long latitude) { return new Iterable<CellId>() { @Override public Iterator<CellId> iterator() { Iterator<CellId> result = new Iterator<CellId>() { private int level = -1; @Override public boolean hasNext() { return level < maxLevel; } @Override public CellId next() { level++; return new CellId(gridMap.get(level).getLevel(), gridMap.get(level).getId(longitude, latitude)); } }; return result; } }; } }
XYGridTree implements Serializable { @SuppressWarnings("Convert2Lambda") public Iterable<CellId> getIds(long longitude, long latitude) { return new Iterable<CellId>() { @Override public Iterator<CellId> iterator() { Iterator<CellId> result = new Iterator<CellId>() { private int level = -1; @Override public boolean hasNext() { return level < maxLevel; } @Override public CellId next() { level++; return new CellId(gridMap.get(level).getLevel(), gridMap.get(level).getId(longitude, latitude)); } }; return result; } }; } XYGridTree(int maxzoom);  XYGridTree(); }
XYGridTree implements Serializable { @SuppressWarnings("Convert2Lambda") public Iterable<CellId> getIds(long longitude, long latitude) { return new Iterable<CellId>() { @Override public Iterator<CellId> iterator() { Iterator<CellId> result = new Iterator<CellId>() { private int level = -1; @Override public boolean hasNext() { return level < maxLevel; } @Override public CellId next() { level++; return new CellId(gridMap.get(level).getLevel(), gridMap.get(level).getId(longitude, latitude)); } }; return result; } }; } XYGridTree(int maxzoom);  XYGridTree(); @SuppressWarnings("Convert2Lambda") Iterable<CellId> getIds(long longitude, long latitude); Iterable<CellId> getIds(double longitude, double latitude); CellId getInsertId(OSHDBBoundingBox bbox); Iterable<CellId> bbox2CellIds(final OSHDBBoundingBox BBOX); @SuppressWarnings("Convert2Lambda") Iterable<CellId> bbox2CellIds(final OSHDBBoundingBox BBOX, final boolean enlarge); @SuppressWarnings("Convert2Lambda") Iterable<CellIdRange> bbox2CellIdRanges(final OSHDBBoundingBox bbox, final boolean enlarge); }
XYGridTree implements Serializable { @SuppressWarnings("Convert2Lambda") public Iterable<CellId> getIds(long longitude, long latitude) { return new Iterable<CellId>() { @Override public Iterator<CellId> iterator() { Iterator<CellId> result = new Iterator<CellId>() { private int level = -1; @Override public boolean hasNext() { return level < maxLevel; } @Override public CellId next() { level++; return new CellId(gridMap.get(level).getLevel(), gridMap.get(level).getId(longitude, latitude)); } }; return result; } }; } XYGridTree(int maxzoom);  XYGridTree(); @SuppressWarnings("Convert2Lambda") Iterable<CellId> getIds(long longitude, long latitude); Iterable<CellId> getIds(double longitude, double latitude); CellId getInsertId(OSHDBBoundingBox bbox); Iterable<CellId> bbox2CellIds(final OSHDBBoundingBox BBOX); @SuppressWarnings("Convert2Lambda") Iterable<CellId> bbox2CellIds(final OSHDBBoundingBox BBOX, final boolean enlarge); @SuppressWarnings("Convert2Lambda") Iterable<CellIdRange> bbox2CellIdRanges(final OSHDBBoundingBox bbox, final boolean enlarge);  }