Class BasicFragmentStore

java.lang.Object
whistleClassifier.BasicFragmentStore
All Implemented Interfaces:
FragmentStore
Direct Known Subclasses:
HistoFragmentStore

public class BasicFragmentStore extends Object implements FragmentStore
  • Constructor Details

    • BasicFragmentStore

      public BasicFragmentStore(float sampleRate)
  • Method Details

    • getLatestParams

      public double[] getLatestParams()
    • getFragmentIterator

      public Iterator<WhistleFragment> getFragmentIterator()
    • addFragemnt

      public void addFragemnt(WhistleFragment newFragment)
      Description copied from interface: FragmentStore
      Add a whistle fragment to the store
      Specified by:
      addFragemnt in interface FragmentStore
      Parameters:
      newFragment - fragment
    • clearStore

      public void clearStore()
      Description copied from interface: FragmentStore
      Clear the store of existing data.
      Specified by:
      clearStore in interface FragmentStore
    • getFitHistogram

      public PamHistogram getFitHistogram(int fit)
      Description copied from interface: FragmentStore
      Get one of the histograms for mean, STD and Skew
      Specified by:
      getFitHistogram in interface FragmentStore
      Parameters:
      fit - histogram number (0, 1 or 2)
      Returns:
      histogram object.
    • getFragmentCount

      public double getFragmentCount()
      Specified by:
      getFragmentCount in interface FragmentStore
    • getNegInflectionsHistogram

      public PamHistogram getNegInflectionsHistogram()
      Specified by:
      getNegInflectionsHistogram in interface FragmentStore
      Returns:
      the negative inflections histogram
    • getParameterArray

      public double[] getParameterArray()
      Description copied from interface: FragmentStore
      Get the parameters (9 of them) describing the fragments in this store.
      Specified by:
      getParameterArray in interface FragmentStore
      Returns:
    • getPosInflectionsHistogram

      public PamHistogram getPosInflectionsHistogram()
      Specified by:
      getPosInflectionsHistogram in interface FragmentStore
      Returns:
      the positive inflections histogram.
    • prepareStore

      public void prepareStore()
      Description copied from interface: FragmentStore
      Prepare the store to receive new data.
      Specified by:
      prepareStore in interface FragmentStore
    • scaleStoreData

      public void scaleStoreData(double scaleFactor)
      Description copied from interface: FragmentStore
      Remove a fraction of the fragments from the store
      Specified by:
      scaleStoreData in interface FragmentStore
      Parameters:
      scaleFactor - fraction of fragments ot leave
    • setSampleRate

      public void setSampleRate(float sampleRate)
      Parameters:
      sampleRate - the sampleRate to set
    • getSampleRate

      public float getSampleRate()
      Returns:
      the sampleRate