Package ch.grengine
Class Grengine.Builder
java.lang.Object
ch.grengine.Grengine.Builder
- Enclosing class:
- Grengine
Builder for instances of
Grengine.- Since:
- 1.0
- Author:
- Alain Stalder, Made in Switzerland.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longthe default latency (5000ms = five seconds). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds a new instance ofGrengine.gets the engine.longgets the latency in milliseconds.gets the source factory for creating sources.gets the sources layers.gets the update notification notifier.sets the engine, default is a new instance ofLayeredEnginewith default settings.setLatencyMs(long latencyMs) sets the latency in milliseconds for checking if need to recompile sources layers, default isDEFAULT_LATENCY_MS.setSourceFactory(SourceFactory sourceFactory) sets the source factory for creating sources, default is a new instance ofDefaultSourceFactorywith default settings.setSourcesLayers(Sources... sourcesLayers) sets the sources layers, default is no layers.setSourcesLayers(List<Sources> sourcesLayers) sets the sources layers, default is no layers.setUpdateExceptionNotifier(UpdateExceptionNotifier updateExceptionNotifier) sets the update notification notifier, default none (null).
-
Field Details
-
DEFAULT_LATENCY_MS
public static final long DEFAULT_LATENCY_MSthe default latency (5000ms = five seconds).- Since:
- 1.0
- See Also:
-
-
Constructor Details
-
Builder
public Builder()constructor.- Since:
- 1.0
-
-
Method Details
-
setEngine
sets the engine, default is a new instance ofLayeredEnginewith default settings.- Parameters:
engine- engine- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
setSourceFactory
sets the source factory for creating sources, default is a new instance ofDefaultSourceFactorywith default settings.- Parameters:
sourceFactory- source factory- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
setSourcesLayers
sets the sources layers, default is no layers.- Parameters:
sourcesLayers- sources layers- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
setSourcesLayers
sets the sources layers, default is no layers.- Parameters:
sourcesLayers- sources layers- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
setUpdateExceptionNotifier
sets the update notification notifier, default none (null).- Parameters:
updateExceptionNotifier- update notification notifier- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
setLatencyMs
sets the latency in milliseconds for checking if need to recompile sources layers, default isDEFAULT_LATENCY_MS.- Parameters:
latencyMs- latency in milliseconds- Returns:
- this, for chaining calls
- Throws:
IllegalStateException- if the builder had already been used to build an instance- Since:
- 1.0
-
getEngine
gets the engine.- Returns:
- engine
- Since:
- 1.0
-
getSourceFactory
gets the source factory for creating sources.- Returns:
- source factory
- Since:
- 1.0
-
getSourcesLayers
gets the sources layers.- Returns:
- sources layers
- Since:
- 1.0
-
getUpdateExceptionNotifier
gets the update notification notifier.- Returns:
- update notification notifier
- Since:
- 1.0
-
getLatencyMs
public long getLatencyMs()gets the latency in milliseconds.- Returns:
- latency in milliseconds
- Since:
- 1.0
-
build
builds a new instance ofGrengine.- Returns:
- new instance
- Since:
- 1.0
-