Class BaseSources

java.lang.Object
ch.grengine.sources.BaseSources
All Implemented Interfaces:
Sources
Direct Known Subclasses:
CompositeSources, DirBasedSources, FixedSetSources

public abstract class BaseSources extends Object implements Sources
Abstract base class for implementing Sources.
Since:
1.0
Author:
Alain Stalder, Made in Switzerland.
  • Constructor Details

    • BaseSources

      public BaseSources()
      constructor.
      Since:
      1.0
  • Method Details

    • init

      public void init(String name, CompilerFactory compilerFactory, long latencyMs)
      initialize.
      Parameters:
      name - sources name
      compilerFactory - compiler factory
      latencyMs - latency in milliseconds for updating
      Since:
      1.0
    • getSourceSetNew

      protected abstract Set<Source> getSourceSetNew()
      gets the updated source set.
      Returns:
      updated source set
      Since:
      1.0
    • getSourceSet

      public Set<Source> getSourceSet()
      Description copied from interface: Sources
      updates the source set, if necessary, and returns it.
      Specified by:
      getSourceSet in interface Sources
      Returns:
      source set
    • getLastModified

      public long getLastModified()
      Description copied from interface: Sources
      updates 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:
      getLastModified in interface Sources
      Returns:
      last modified
    • getName

      public String getName()
      Description copied from interface: Sources
      gets the name of the sources.
      Specified by:
      getName in interface Sources
      Returns:
      name of the sources
    • getCompilerFactory

      public CompilerFactory getCompilerFactory()
      Description copied from interface: Sources
      gets the compiler factory that should be used to compile the sources.
      Specified by:
      getCompilerFactory in interface Sources
      Returns:
      compiler factory
    • toString

      public String toString()
      Description copied from interface: Sources
      returns a string suitable for logging.
      Specified by:
      toString in interface Sources
      Overrides:
      toString in class Object
      Returns:
      a string suitable for logging