Package ch.grengine.sources
Class BaseSources
java.lang.Object
ch.grengine.sources.BaseSources
- All Implemented Interfaces:
Sources
- Direct Known Subclasses:
CompositeSources,DirBasedSources,FixedSetSources
Abstract base class for implementing
Sources.- Since:
- 1.0
- Author:
- Alain Stalder, Made in Switzerland.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongets the compiler factory that should be used to compile the sources.longupdates the source set, if necessary, and returns the last modified of when last found changed.getName()gets the name of the sources.updates the source set, if necessary, and returns it.gets the updated source set.voidinit(String name, CompilerFactory compilerFactory, long latencyMs) initialize.toString()returns a string suitable for logging.
-
Constructor Details
-
BaseSources
public BaseSources()constructor.- Since:
- 1.0
-
-
Method Details
-
init
initialize.- Parameters:
name- sources namecompilerFactory- compiler factorylatencyMs- latency in milliseconds for updating- Since:
- 1.0
-
getSourceSetNew
gets the updated source set.- Returns:
- updated source set
- Since:
- 1.0
-
getSourceSet
Description copied from interface:Sourcesupdates the source set, if necessary, and returns it.- Specified by:
getSourceSetin interfaceSources- Returns:
- source set
-
getLastModified
public long getLastModified()Description copied from interface:Sourcesupdates the source set, if necessary, and returns the last modified of when last found changed.You should not rely on this number to increase monotonically or even to represent an actual date and time, but instead consider the sources changed each time this method returns a different value.
- Specified by:
getLastModifiedin interfaceSources- Returns:
- last modified
-
getName
Description copied from interface:Sourcesgets the name of the sources. -
getCompilerFactory
Description copied from interface:Sourcesgets the compiler factory that should be used to compile the sources.- Specified by:
getCompilerFactoryin interfaceSources- Returns:
- compiler factory
-
toString
Description copied from interface:Sourcesreturns a string suitable for logging.
-