Package net.sf.gridarta.model.index
Class MapsIndexer<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.index.MapsIndexer<G,A,R>
-
public class MapsIndexer<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.ObjectMaintains aMapsIndexfor the maps directory. Changed maps are tracked and the index is updated.
-
-
Constructor Summary
Constructors Constructor Description MapsIndexer(@NotNull MapsIndex mapsIndex, @NotNull MapManager<G,A,R> mapManager, @NotNull ProjectSettings projectSettings)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidstart()Starts indexing.voidstop()Stops indexing.voidwaitForIdle()Blocks the calling thread until all pending maps have been indexed.
-
-
-
Constructor Detail
-
MapsIndexer
public MapsIndexer(@NotNull @NotNull MapsIndex mapsIndex, @NotNull @NotNull MapManager<G,A,R> mapManager, @NotNull @NotNull ProjectSettings projectSettings)Creates a new instance.- Parameters:
mapsIndex- the maps index to updatemapManager- the map manager for loading map filesprojectSettings- the project settings instance; defines the indexed maps directory
-
-
Method Detail
-
start
public void start()
Starts indexing. Must not be called more than once.
-
stop
public void stop() throws java.lang.InterruptedExceptionStops indexing. Must not be called more than once or beforestart()has been called.- Throws:
java.lang.InterruptedException- if the current thread was interrupted
-
waitForIdle
public void waitForIdle() throws java.lang.InterruptedExceptionBlocks the calling thread until all pending maps have been indexed.- Throws:
java.lang.InterruptedException- if the current thread was interrupted during wait
-
-