All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.seninp.jmotif.sax.registry.LargeWindowAlgorithm Maven / Gradle / Ivy

package net.seninp.jmotif.sax.registry;


/**
 * Implements a large window marker.
 * 
 * @author psenin
 * 
 */
public class LargeWindowAlgorithm implements SlidingWindowMarkerAlgorithm {

  @Override
  public void markVisited(VisitRegistry registry, int startPosition, int intervalLength) {
    // mark to the right of start position
    for (int i = 0; i < intervalLength; i++) {
      if (startPosition + i > registry.size() - 1) {
        break;
      }
      registry.markVisited(startPosition + i);
    }
    // grow left
    for (int i = 0; i < intervalLength; i++) {
      if (startPosition - i < 0) {
        break;
      }
      registry.markVisited(startPosition - i);
    }

  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy