Class ShingleFilter.CircularSequence

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void advance()
      Increments this circular number's value to the next member in the circular sequence gramSize will take on values from the circular sequence { [ 1, ] ShingleFilter.minShingleSize [ , ...
      boolean atMinValue()
      Returns true if the current value is the first member of the circular sequence.
      int getPreviousValue()  
      int getValue()  
      void reset()
      Sets this circular number's value to the first member of the circular sequence
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • value

        private int value
      • previousValue

        private int previousValue
      • minValue

        private int minValue
    • Constructor Detail

      • CircularSequence

        public CircularSequence()
    • Method Detail

      • getValue

        public int getValue()
        Returns:
        the current value.
        See Also:
        advance()
      • atMinValue

        public boolean atMinValue()

        Returns true if the current value is the first member of the circular sequence.

        If ShingleFilter.outputUnigrams = true, the first member of the circular sequence will be 1; otherwise, it will be ShingleFilter.minShingleSize.

        Returns:
        true if the current value is the first member of the circular sequence; false otherwise
      • getPreviousValue

        public int getPreviousValue()
        Returns:
        the value this instance had before the last advance() call