Package clickDetector

Class RainbowFile

java.lang.Object
clickDetector.RainbowFile
All Implemented Interfaces:
ClickFileStorage

public class RainbowFile extends Object implements ClickFileStorage
Author:
Doug Gillespie

Creates a file in the RainbowClick file format. Required Rainbowclick structures are subclasses of RainbowFile. The class is also responsible for holding the file handle, etc.

Not all RainbowClick structures are implemented since may of them contain no useful data. Parameter settings will be added to other Pam storage as that developes.

  • Field Details

  • Constructor Details

  • Method Details

    • openClickStorage

      public boolean openClickStorage(long sampleOffset)
      Open a new rainbowFile for storage.
      Specified by:
      openClickStorage in interface ClickFileStorage
    • openClickStorage

      public boolean openClickStorage(File oldFile)
      Open an old rainbowclick file to reload data for viewing or for batch conversion into binary files.
    • gotoSectionHead

      public boolean gotoSectionHead(int iSection)
    • gotoSectionData

      public boolean gotoSectionData(int iSection)
    • closeClickStorage

      public void closeClickStorage()
      Specified by:
      closeClickStorage in interface ClickFileStorage
    • getNumSections

      public int getNumSections()
      Returns:
      the number of sections in an old style RC file.
    • writeClickStructures

      public boolean writeClickStructures(ClickParameters clickParameters)
      Specified by:
      writeClickStructures in interface ClickFileStorage
    • readClickStructures

      public boolean readClickStructures(ClickParameters clickParameters)
    • readClickStructures

      public boolean readClickStructures(ClickParameters clickParameters, boolean fromStart)
      Read click head structures from a rainbowclick file.
      Parameters:
      clickParameters -
      Returns:
      true if read ok, false otherwise
    • moveToClicks

      public boolean moveToClicks()
    • getNextClick

      public ClickDetection getNextClick()
      Get the next clicks from the file. Assume that the file pointer is in the right place, etc.
      Returns:
      next click, or null if EOF.
    • writeClickStructure

      public boolean writeClickStructure(int structId, ClickParameters clickParameters)
    • readClickStructure

      public boolean readClickStructure(int structId, ClickParameters clickParameters)
    • writeSCSettings

      public boolean writeSCSettings(ClickParameters clickParameters)
    • readSCSettings

      public boolean readSCSettings(ClickParameters clickParameters)
    • writeClickHeader

      public boolean writeClickHeader(ClickDetection click)
      Specified by:
      writeClickHeader in interface ClickFileStorage
    • reWriteClick

      public boolean reWriteClick(ClickDetection click)
    • writeClick

      public boolean writeClick(ClickDetection click)
      Specified by:
      writeClick in interface ClickFileStorage
    • getStorageName

      public String getStorageName()
      Specified by:
      getStorageName in interface ClickFileStorage
    • checkStorage

      public boolean checkStorage()
      Specified by:
      checkStorage in interface ClickFileStorage
    • checkStorage

      public static boolean checkStorage(String dirName)
    • getFileStartTime

      public long getFileStartTime()
      Returns:
      the file start time in standard Java milliseconds
    • getFileEndTime

      public long getFileEndTime()
      Returns:
      the file end time in standard Java milliseconds
    • getSampleRate

      public float getSampleRate()
      Returns:
      the files sample rate in Hz
    • getRainbowFile

      public File getRainbowFile()
      Get the current File object
      Returns:
      File object.
    • getNClicksInFile

      public int getNClicksInFile()
      Returns:
      the nClicksInFile