Class BaseSource

java.lang.Object
ch.grengine.source.BaseSource
All Implemented Interfaces:
Source
Direct Known Subclasses:
DefaultFileSource, DefaultTextSource, DefaultUrlSource

public abstract class BaseSource extends Object implements Source
Abstract base implementation of the Source interface.
Since:
1.0
Author:
Alain Stalder, Made in Switzerland.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    the source id.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    protected constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    implementation based on the protected member variable id.
    gets the protected member variable id.
    long
    always returns 0.
    int
    implementation based on the protected member variable id.
    returns a string suitable for logging.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • id

      protected String id
      the source id.
      Since:
      1.0
  • Constructor Details

    • BaseSource

      protected BaseSource()
      protected constructor.
      Since:
      1.0
  • Method Details

    • getId

      public String getId()
      gets the protected member variable id.
      Specified by:
      getId in interface Source
      Returns:
      id
      Since:
      1.0
    • getLastModified

      public long getLastModified()
      always returns 0.
      Specified by:
      getLastModified in interface Source
      Returns:
      always 0
      Since:
      1.0
    • equals

      public boolean equals(Object obj)
      implementation based on the protected member variable id.
      Specified by:
      equals in interface Source
      Overrides:
      equals in class Object
      Returns:
      whether the two sources are equal
      Since:
      1.0
    • hashCode

      public int hashCode()
      implementation based on the protected member variable id.
      Specified by:
      hashCode in interface Source
      Overrides:
      hashCode in class Object
      Returns:
      hash code of the source ID
      Since:
      1.0
    • toString

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