public void Add(Location location) { if (location.getTime() - timeLastUpdate > RESET_PERIOD) reset(); locations[head++ % size] = location; timeLastUpdate = location.getTime(); }