@Test public void testTileTimesSet1() { SortedSet<ScheduledTime> expected = new TreeSet(ImmutableSet.of(new ScheduledTime("2015-08-06T18:00Z"), new ScheduledTime("2015-08-06T19:00Z"), new ScheduledTime("2015-08-06T20:00Z"))); Assert.assertEquals(expected, UIServlet.getTileTimesSet(new ScheduledTime("2015-08-06T20:00Z"), 60, 1000, 3)); }
static NavigableSet<ScheduledTime> getTileTimesSet(ScheduledTime firstTileTime, int zoomLevelMinutes, int maxMinutesToFetch, int maxTilesToDisplay) { int numTiles = getNumTiles(zoomLevelMinutes, maxMinutesToFetch, maxTilesToDisplay); TreeSet<ScheduledTime> times = new TreeSet<>(); ScheduledTime t = firstTileTime; for (int i = 1; i <= numTiles; i++) { times.add(t); t = t.minusMinutes(zoomLevelMinutes); } return times; }
UIServlet extends HttpServlet { static NavigableSet<ScheduledTime> getTileTimesSet(ScheduledTime firstTileTime, int zoomLevelMinutes, int maxMinutesToFetch, int maxTilesToDisplay) { int numTiles = getNumTiles(zoomLevelMinutes, maxMinutesToFetch, maxTilesToDisplay); TreeSet<ScheduledTime> times = new TreeSet<>(); ScheduledTime t = firstTileTime; for (int i = 1; i <= numTiles; i++) { times.add(t); t = t.minusMinutes(zoomLevelMinutes); } return times; } }
UIServlet extends HttpServlet { static NavigableSet<ScheduledTime> getTileTimesSet(ScheduledTime firstTileTime, int zoomLevelMinutes, int maxMinutesToFetch, int maxTilesToDisplay) { int numTiles = getNumTiles(zoomLevelMinutes, maxMinutesToFetch, maxTilesToDisplay); TreeSet<ScheduledTime> times = new TreeSet<>(); ScheduledTime t = firstTileTime; for (int i = 1; i <= numTiles; i++) { times.add(t); t = t.minusMinutes(zoomLevelMinutes); } return times; }  }
UIServlet extends HttpServlet { static NavigableSet<ScheduledTime> getTileTimesSet(ScheduledTime firstTileTime, int zoomLevelMinutes, int maxMinutesToFetch, int maxTilesToDisplay) { int numTiles = getNumTiles(zoomLevelMinutes, maxMinutesToFetch, maxTilesToDisplay); TreeSet<ScheduledTime> times = new TreeSet<>(); ScheduledTime t = firstTileTime; for (int i = 1; i <= numTiles; i++) { times.add(t); t = t.minusMinutes(zoomLevelMinutes); } return times; }   }
UIServlet extends HttpServlet { static NavigableSet<ScheduledTime> getTileTimesSet(ScheduledTime firstTileTime, int zoomLevelMinutes, int maxMinutesToFetch, int maxTilesToDisplay) { int numTiles = getNumTiles(zoomLevelMinutes, maxMinutesToFetch, maxTilesToDisplay); TreeSet<ScheduledTime> times = new TreeSet<>(); ScheduledTime t = firstTileTime; for (int i = 1; i <= numTiles; i++) { times.add(t); t = t.minusMinutes(zoomLevelMinutes); } return times; }    }