Class SOSSPReader

java.lang.Object
application.model.database.DatabaseReader
application.model.database.SOSSPReader

public class SOSSPReader
extends DatabaseReader
Reads the Smallest Oscillator Supporting Specfic Periods (SOSSP) database. Assumes the database is sorted by period.
Example Usage:

 SOSSPReader reader = new SOSSPReader(new File("sossp.sss.txt"))
 System.out.println(Utils.fullRLE(reader.getOscByPeriod(2047)))
 
  • Constructor Summary

    Constructors 
    Constructor Description
    SOSSPReader​(java.io.File file)
    Constructs the reader
  • Method Summary

    Modifier and Type Method Description
    Oscillator getOscByPeriod​(int period)
    Gets an oscillator in the database by its period.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SOSSPReader

      public SOSSPReader​(java.io.File file) throws java.io.IOException
      Constructs the reader
      Parameters:
      file - The file where the database is stored
      Throws:
      java.io.IOException - Thrown if there is an IOException while reading the file
  • Method Details

    • getOscByPeriod

      public Oscillator getOscByPeriod​(int period)
      Gets an oscillator in the database by its period. Uses binary search for speed.
      Parameters:
      period - The period of the oscillator
      Returns:
      Returns the oscillator