Tabnine Logo
DaciukMihovAutomatonBuilder$State.lastChild
Code IndexAdd Tabnine to your IDE (free)

How to use
lastChild
method
in
org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder$State

Best Java code snippets using org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder$State.lastChild (Showing top 8 results out of 315)

origin: org.apache.lucene/lucene-core

/**
 * Add another character sequence to this automaton. The sequence must be
 * lexicographically larger or equal compared to any previous sequences added
 * to this automaton (the input must be sorted).
 */
public void add(CharsRef current) {
 if (current.length > MAX_TERM_LENGTH) {
  throw new IllegalArgumentException("This builder doesn't allow terms that are larger than 1,000 characters, got " + current);
 }
 assert stateRegistry != null : "Automaton already built.";
 assert previous == null
   || comparator.compare(previous, current) <= 0 : "Input must be in sorted UTF-8 order: "
   + previous + " >= " + current;
 assert setPrevious(current);
 // Descend in the automaton (find matching prefix).
 int pos = 0, max = current.length();
 State next, state = root;
 while (pos < max && (next = state.lastChild(Character.codePointAt(current, pos))) != null) {
  state = next;
  // todo, optimize me
  pos += Character.charCount(Character.codePointAt(current, pos));
 }
 
 if (state.hasChildren()) replaceOrRegister(state);
 
 addSuffix(state, current, pos);
}

origin: org.apache.lucene/lucene-core

/**
 * Replace last child of <code>state</code> with an already registered state
 * or stateRegistry the last child state.
 */
private void replaceOrRegister(State state) {
 final State child = state.lastChild();
 
 if (child.hasChildren()) replaceOrRegister(child);
 
 final State registered = stateRegistry.get(child);
 if (registered != null) {
  state.replaceLastChild(registered);
 } else {
  stateRegistry.put(child, child);
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Add another character sequence to this automaton. The sequence must be
 * lexicographically larger or equal compared to any previous sequences added
 * to this automaton (the input must be sorted).
 */
public void add(CharsRef current) {
 if (current.length > MAX_TERM_LENGTH) {
  throw new IllegalArgumentException("This builder doesn't allow terms that are larger than 1,000 characters, got " + current);
 }
 assert stateRegistry != null : "Automaton already built.";
 assert previous == null
   || comparator.compare(previous, current) <= 0 : "Input must be in sorted UTF-8 order: "
   + previous + " >= " + current;
 assert setPrevious(current);
 // Descend in the automaton (find matching prefix).
 int pos = 0, max = current.length();
 State next, state = root;
 while (pos < max && (next = state.lastChild(Character.codePointAt(current, pos))) != null) {
  state = next;
  // todo, optimize me
  pos += Character.charCount(Character.codePointAt(current, pos));
 }
 
 if (state.hasChildren()) replaceOrRegister(state);
 
 addSuffix(state, current, pos);
}

origin: harbby/presto-connectors

/**
 * Add another character sequence to this automaton. The sequence must be
 * lexicographically larger or equal compared to any previous sequences added
 * to this automaton (the input must be sorted).
 */
public void add(CharsRef current) {
 assert stateRegistry != null : "Automaton already built.";
 assert previous == null
   || comparator.compare(previous, current) <= 0 : "Input must be in sorted UTF-8 order: "
   + previous + " >= " + current;
 assert setPrevious(current);
 // Descend in the automaton (find matching prefix).
 int pos = 0, max = current.length();
 State next, state = root;
 while (pos < max && (next = state.lastChild(Character.codePointAt(current, pos))) != null) {
  state = next;
  // todo, optimize me
  pos += Character.charCount(Character.codePointAt(current, pos));
 }
 
 if (state.hasChildren()) replaceOrRegister(state);
 
 addSuffix(state, current, pos);
}

origin: org.infinispan/infinispan-embedded-query

/**
 * Add another character sequence to this automaton. The sequence must be
 * lexicographically larger or equal compared to any previous sequences added
 * to this automaton (the input must be sorted).
 */
public void add(CharsRef current) {
 assert stateRegistry != null : "Automaton already built.";
 assert previous == null
   || comparator.compare(previous, current) <= 0 : "Input must be in sorted UTF-8 order: "
   + previous + " >= " + current;
 assert setPrevious(current);
 // Descend in the automaton (find matching prefix).
 int pos = 0, max = current.length();
 State next, state = root;
 while (pos < max && (next = state.lastChild(Character.codePointAt(current, pos))) != null) {
  state = next;
  // todo, optimize me
  pos += Character.charCount(Character.codePointAt(current, pos));
 }
 
 if (state.hasChildren()) replaceOrRegister(state);
 
 addSuffix(state, current, pos);
}

origin: harbby/presto-connectors

/**
 * Replace last child of <code>state</code> with an already registered state
 * or stateRegistry the last child state.
 */
private void replaceOrRegister(State state) {
 final State child = state.lastChild();
 
 if (child.hasChildren()) replaceOrRegister(child);
 
 final State registered = stateRegistry.get(child);
 if (registered != null) {
  state.replaceLastChild(registered);
 } else {
  stateRegistry.put(child, child);
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Replace last child of <code>state</code> with an already registered state
 * or stateRegistry the last child state.
 */
private void replaceOrRegister(State state) {
 final State child = state.lastChild();
 
 if (child.hasChildren()) replaceOrRegister(child);
 
 final State registered = stateRegistry.get(child);
 if (registered != null) {
  state.replaceLastChild(registered);
 } else {
  stateRegistry.put(child, child);
 }
}
origin: org.infinispan/infinispan-embedded-query

/**
 * Replace last child of <code>state</code> with an already registered state
 * or stateRegistry the last child state.
 */
private void replaceOrRegister(State state) {
 final State child = state.lastChild();
 
 if (child.hasChildren()) replaceOrRegister(child);
 
 final State registered = stateRegistry.get(child);
 if (registered != null) {
  state.replaceLastChild(registered);
 } else {
  stateRegistry.put(child, child);
 }
}
org.apache.lucene.util.automatonDaciukMihovAutomatonBuilder$StatelastChild

Javadoc

Return the most recent transitions's target state.

Popular methods of DaciukMihovAutomatonBuilder$State

  • <init>
  • getState
    Returns the target state of a transition leaving this state and labeled with label. If no such tran
  • hasChildren
    Return true if this state has any children (outgoing transitions).
  • newState
    Create a new outgoing transition labeled label and return the newly created target state for this tr
  • referenceEquals
    Compare two lists of objects for reference-equality.
  • replaceLastChild
    Replace the last added outgoing transition's target state with the given state.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now