не мог понять работу кода в списке параметров LocationFinder.getFinder, то есть класс new LocationFinder.Listener()Как может быть список параметров метода-тела у класса?
заставьте меня понять, что это.
private LocationFinder locationFinder;
private ViewMaster viewMaster;
private synchronized void initLocationFinder() {
if (locationFinder == null) {
**locationFinder =LocationFinder.getFinder(new LocationFinder.Listener()
{
public void newLocation(double lat, double lon, int accuracy) {
DataModel.getInstance().setCurrentPosition(new GeoCoordinate(lat, lon, 0), accuracy);
refreshCurrentPositionOnMap();
if (viewMaster != null) {
viewMaster.draw();
}
}
});**
}
}
где LocationFinder является абстрактным классом
public static LocationFinder getFinder(Listener listener)
{
// returns finder which is reference of LocationFinder class
}
и Слушатель представляет собой интерфейс
public interface Listener {
void newLocation(double lat, double lon, int accuracy);
}
еще ViewMaster является окончательным класс расширяет GameCanvas
public final class ViewMaster extends GameCanvas {
private volatile boolean refreshScreen = false;
public final void draw() {
refreshScreen = true;
}
здесь, что делает V Обилие булевых средств?