Package application.model.database
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:
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.
-
Constructor Details
-
SOSSPReader
public SOSSPReader(java.io.File file) throws java.io.IOExceptionConstructs 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
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
-