Example #1
0
  @Override
  protected boolean filter(final QueryContext ctx, final FTMatch mtc, final FTLexer lex) {

    if (same) {
      int s = -1;
      for (final FTStringMatch sm : mtc) {
        if (sm.ex) continue;
        final int p = pos(sm.s, lex);
        if (s == -1) s = p;
        else if (s != p) return false;
      }
      return true;
    }
    int c = 0;
    final BoolList bl = new BoolList();
    for (final FTStringMatch sm : mtc) {
      if (sm.ex) continue;
      c++;
      final int p = pos(sm.s, lex);
      final int s = bl.size();
      if (p < s && bl.get(p) && p == pos(sm.e, lex)) return false;
      bl.set(true, p);
    }
    return c > 1;
  }
Example #2
0
 /** Finishes the index creation. */
 void finish() {
   if (reorder == null) return;
   for (int i = 1; i < reorder.size(); i++) {
     if (reorder.get(i)) Arrays.sort(idsList.get(i), 0, lenList.get(i));
   }
   reorder = null;
 }
Example #3
0
 /**
  * Choose a unique tab file.
  *
  * @return io reference
  */
 private IOFile newTabFile() {
   // collect numbers of existing files
   final BoolList bl = new BoolList();
   for (final EditorArea edit : editors()) {
     if (edit.opened()) continue;
     final String n = edit.file.name().substring(FILE.length());
     bl.set(n.isEmpty() ? 1 : Integer.parseInt(n), true);
   }
   // find first free file number
   int c = 0;
   while (++c < bl.size() && bl.get(c)) ;
   // create io reference
   return new IOFile(gui.gprop.get(GUIProp.WORKPATH), FILE + (c == 1 ? "" : c));
 }