Code example for MatchResult

Methods: end, start

0
    }; 
 
  public final static Comparator<MatchResult> OFFSET_COMPARATOR =
    new Comparator<MatchResult>() { 
      public int compare(MatchResult e1, MatchResult e2) { 
        if (e1.start() == e2.start()) { 
          if (e1.end() == e2.end()) { 
            return 0; 
          } else { 
            return (e1.end() < e2.end())? -1:1; 
          } 
        } else { 
          return (e1.start() < e2.start())? -1:1; 
        } 
      } 
    }; 
 
  // Compares two match results. 
  // Use to order match results by: 
   //   score 
  //    length (longest first),