/** returns true if term is within k edits of the query term */ private boolean matches(BytesRef termIn, int k) { return k == 0 ? termIn.equals(term.bytes()) : automata[k].runAutomaton.run(termIn.bytes, termIn.offset, termIn.length); }
/** * Returns true if the term matches the automaton. Also stashes away the term * to assist with smart enumeration. */ @Override protected AcceptStatus accept(final BytesRef term) { if (commonSuffixRef == null || StringHelper.endsWith(term, commonSuffixRef)) { if (runAutomaton.run(term.bytes, term.offset, term.length)) return linear ? AcceptStatus.YES : AcceptStatus.YES_AND_SEEK; else return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } else { return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } }
/** * Returns whether the given value is accepted based on the {@code include} & {@code exclude} patterns. */ @Override public boolean accept(BytesRef value) { return runAutomaton.run(value.bytes, value.offset, value.length); } }
/** * Returns whether the given value is accepted based on the {@code include} & {@code exclude} patterns. */ @Override public boolean accept(BytesRef value) { return runAutomaton.run(value.bytes, value.offset, value.length); } }
/** * Returns whether the given value is accepted based on the {@code include} & {@code exclude} patterns. */ @Override public boolean accept(BytesRef value) { return runAutomaton.run(value.bytes, value.offset, value.length); } }
/** * Returns whether the given value is accepted based on the {@code include} & {@code exclude} patterns. */ @Override public boolean accept(BytesRef value) { return runAutomaton.run(value.bytes, value.offset, value.length); } }
/** * Returns whether the given value is accepted based on the {@code include} & {@code exclude} patterns. */ @Override public boolean accept(BytesRef value) { return runAutomaton.run(value.bytes, value.offset, value.length); } }
/** * Returns whether the given value is accepted based on the {@code include} & {@code exclude} patterns. */ @Override public boolean accept(BytesRef value) { return runAutomaton.run(value.bytes, value.offset, value.length); } }
/** returns true if term is within k edits of the query term */ final boolean matches(BytesRef term, int k) { return k == 0 ? term.equals(termRef) : matchers[k].run(term.bytes, term.offset, term.length); } }
public boolean matches(BytesRef term) { if (compiled == null) { compiled = new ByteRunAutomaton(automaton); } return compiled.run(term.bytes, term.offset, term.length); } }
/** returns true if term is within k edits of the query term */ final boolean matches(BytesRef term, int k) { return k == 0 ? term.equals(termRef) : matchers[k].run(term.bytes, term.offset, term.length); } }
/** returns true if term is within k edits of the query term */ private boolean matches(BytesRef termIn, int k) { return k == 0 ? termIn.equals(term.bytes()) : automata[k].runAutomaton.run(termIn.bytes, termIn.offset, termIn.length); }
/** * Returns true if the term matches the automaton. Also stashes away the term * to assist with smart enumeration. */ @Override protected AcceptStatus accept(final BytesRef term) { if (commonSuffixRef == null || StringHelper.endsWith(term, commonSuffixRef)) { if (runAutomaton.run(term.bytes, term.offset, term.length)) return linear ? AcceptStatus.YES : AcceptStatus.YES_AND_SEEK; else return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } else { return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } }
/** * Returns true if the term matches the automaton. Also stashes away the term * to assist with smart enumeration. */ @Override protected AcceptStatus accept(final BytesRef term) { if (commonSuffixRef == null || StringHelper.endsWith(term, commonSuffixRef)) { if (runAutomaton.run(term.bytes, term.offset, term.length)) return linear ? AcceptStatus.YES : AcceptStatus.YES_AND_SEEK; else return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } else { return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } }
/** * Returns true if the term matches the automaton. Also stashes away the term * to assist with smart enumeration. */ @Override protected AcceptStatus accept(final BytesRef term) { if (commonSuffixRef == null || StringHelper.endsWith(term, commonSuffixRef)) { if (runAutomaton.run(term.bytes, term.offset, term.length)) return linear ? AcceptStatus.YES : AcceptStatus.YES_AND_SEEK; else return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } else { return (linear && term.compareTo(linearUpperBound) < 0) ? AcceptStatus.NO : AcceptStatus.NO_AND_SEEK; } }