Package org.rabinfingerprint.scanner.StringFinder

Examples of org.rabinfingerprint.scanner.StringFinder.StringMatcher


    final StringFinder scanner = new StringFinder(targetString);
   
    // find
    for (final File file : files) {
      final String str = IOUtils.readEntireFile(file);
      final StringMatcher sm = scanner.matcher(str);
      LineNumberIndex index = null;
     
      // find matching strings
      while (sm.find()) {
        if (index == null) index = new LineNumberIndex(str);
        final int off = sm.getStart();
        final int lineOffset = index.getLineNumber(off);
        final String line = index.getLine(off);
        final StringMatch match = new StringMatch(file, line, lineOffset, off);
        visitor.found(match);
      }
View Full Code Here


    for (final File file : files) {
      executor.submit(new Runnable() {
        public void run() {
          try {
            final String str = IOUtils.readEntireFile(file);
            final StringMatcher sm = scanner.matcher(str);
            LineNumberIndex index = null;

            // find matching strings
            while (sm.find()) {
              if (index == null) index = new LineNumberIndex(str);
              final int off = sm.getStart();
              final int lineOffset = index.getLineNumber(off);
              final String line = index.getLine(off);
              final StringMatch match = new StringMatch(file, line, lineOffset, off);
              visitor.found(match);
            }
View Full Code Here

TOP

Related Classes of org.rabinfingerprint.scanner.StringFinder.StringMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.