Codota Logo
FSTEnum
Code IndexAdd Codota to your IDE (free)

How to use
FSTEnum
in
org.apache.lucene.util.fst

Best Java code snippets using org.apache.lucene.util.fst.FSTEnum (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: org.apache.lucene/lucene-core

/** Seeks to smallest term that's >= target. */
public InputOutput<T> seekCeil(BytesRef target) throws IOException {
 this.target = target;
 targetLength = target.length;
 super.doSeekCeil();
 return setResult();
}
origin: org.apache.lucene/lucene-core

/** Seeks to exactly this term, returning null if the term
 *  doesn't exist.  This is faster than using {@link
 *  #seekFloor} or {@link #seekCeil} because it
 *  short-circuits as soon the match is not found. */
public InputOutput<T> seekExact(IntsRef target) throws IOException {
 this.target = target;
 targetLength = target.length;
 if (super.doSeekExact()) {
  assert upto == 1+target.length;
  return setResult();
 } else {
  return null;
 }
}
origin: org.apache.lucene/lucene-core

/** Seeks to biggest term that's &lt;= target. */
public InputOutput<T> seekFloor(IntsRef target) throws IOException {
 this.target = target;
 targetLength = target.length;
 super.doSeekFloor();
 return setResult();
}
origin: org.apache.lucene/lucene-core

private void pushLast() throws IOException {
 FST.Arc<T> arc = arcs[upto];
 assert arc != null;
 while (true) {
  setCurrentLabel(arc.label);
  output[upto] = fst.outputs.add(output[upto-1], arc.output);
  if (arc.label == FST.END_LABEL) {
   // Final node
   break;
  }
  incr();
  arc = fst.readLastTargetArc(arc, getArc(upto), fstReader);
 }
}
origin: org.apache.lucene/lucene-core

/** Rewinds enum state to match the shared prefix between
 *  current term and target term */
protected final void rewindPrefix() throws IOException {
 if (upto == 0) {
  //System.out.println("  init");
  upto = 1;
  fst.readFirstTargetArc(getArc(0), getArc(1), fstReader);
  return;
 }
 //System.out.println("  rewind upto=" + upto + " vs targetLength=" + targetLength);
 final int currentLimit = upto;
 upto = 1;
 while (upto < currentLimit && upto <= targetLength+1) {
  final int cmp = getCurrentLabel() - getTargetLabel();
  if (cmp < 0) {
   // seek forward
   //System.out.println("    seek fwd");
   break;
  } else if (cmp > 0) {
   // seek backwards -- reset this arc to the first arc
   final FST.Arc<T> arc = getArc(upto);
   fst.readFirstTargetArc(getArc(upto-1), arc, fstReader);
   //System.out.println("    seek first arc");
   break;
  }
  upto++;
 }
 //System.out.println("  fall through upto=" + upto);
}
origin: org.apache.lucene/lucene-core

rewindPrefix();
FST.Arc<T> arc = getArc(upto-1);
int targetLabel = getTargetLabel();
 final FST.Arc<T> nextArc = fst.findTargetArc(targetLabel, arc, getArc(upto), fstReader);
 if (nextArc == null) {
  fst.readFirstTargetArc(arc, getArc(upto), fstReader);
 setCurrentLabel(targetLabel);
 incr();
 targetLabel = getTargetLabel();
 arc = nextArc;
origin: org.apache.lucene/lucene-core

protected void doNext() throws IOException {
 //System.out.println("FE: next upto=" + upto);
 if (upto == 0) {
  //System.out.println("  init");
  upto = 1;
  fst.readFirstTargetArc(getArc(0), getArc(1), fstReader);
 } else {
  // pop
  //System.out.println("  check pop curArc target=" + arcs[upto].target + " label=" + arcs[upto].label + " isLast?=" + arcs[upto].isLast());
  while (arcs[upto].isLast()) {
   upto--;
   if (upto == 0) {
    //System.out.println("  eof");
    return;
   }
  }
  fst.readNextArc(arcs[upto], fstReader);
 }
 pushFirst();
}
origin: org.apache.lucene/lucene-core

/** doFloor controls the behavior of advance: if it's true
 *  doFloor is true, advance positions to the biggest
 *  term before target.  */
protected FSTEnum(FST<T> fst) {
 this.fst = fst;
 fstReader = fst.getBytesReader();
 NO_OUTPUT = fst.outputs.getNoOutput();
 fst.getFirstArc(getArc(0));
 output[0] = NO_OUTPUT;
}
origin: org.apache.lucene/lucene-core

private void incr() {
 upto++;
 grow();
 if (arcs.length <= upto) {
  @SuppressWarnings({"rawtypes","unchecked"}) final FST.Arc<T>[] newArcs =
   new FST.Arc[ArrayUtil.oversize(1+upto, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];
  System.arraycopy(arcs, 0, newArcs, 0, arcs.length);
  arcs = newArcs;
 }
 if (output.length <= upto) {
  @SuppressWarnings({"rawtypes","unchecked"}) final T[] newOutput =
   (T[]) new Object[ArrayUtil.oversize(1+upto, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];
  System.arraycopy(output, 0, newOutput, 0, output.length);
  output = newOutput;
 }
}
origin: org.apache.lucene/lucene-core

rewindPrefix();
FST.Arc<T> arc = getArc(upto);
int targetLabel = getTargetLabel();
   setCurrentLabel(arc.label);
   incr();
   arc = fst.readFirstTargetArc(arc, getArc(upto), fstReader);
   targetLabel = getTargetLabel();
   continue;
  } else if (high == -1) {
    fst.readFirstTargetArc(getArc(upto-1), arc, fstReader);
    if (arc.label < targetLabel) {
     pushLast();
     return;
    targetLabel = getTargetLabel();
    arc = getArc(upto);
   assert arc.isLast() || fst.readNextArcLabel(arc, in) > targetLabel;
   assert arc.label < targetLabel: "arc.label=" + arc.label + " vs targetLabel=" + targetLabel;
   pushLast();
   return;
   setCurrentLabel(arc.label);
   incr();
   arc = fst.readFirstTargetArc(arc, getArc(upto), fstReader);
origin: org.apache.lucene/lucene-core

private void pushFirst() throws IOException {
 FST.Arc<T> arc = arcs[upto];
 assert arc != null;
 while (true) {
  output[upto] = fst.outputs.add(output[upto-1], arc.output);
  if (arc.label == FST.END_LABEL) {
   // Final node
   break;
  }
  //System.out.println("  pushFirst label=" + (char) arc.label + " upto=" + upto + " output=" + fst.outputs.outputToString(output[upto]));
  setCurrentLabel(arc.label);
  incr();
  
  final FST.Arc<T> nextArc = getArc(upto);
  fst.readFirstTargetArc(arc, nextArc, fstReader);
  arc = nextArc;
 }
}
origin: org.infinispan/infinispan-embedded-query

/** Rewinds enum state to match the shared prefix between
 *  current term and target term */
protected final void rewindPrefix() throws IOException {
 if (upto == 0) {
  //System.out.println("  init");
  upto = 1;
  fst.readFirstTargetArc(getArc(0), getArc(1), fstReader);
  return;
 }
 //System.out.println("  rewind upto=" + upto + " vs targetLength=" + targetLength);
 final int currentLimit = upto;
 upto = 1;
 while (upto < currentLimit && upto <= targetLength+1) {
  final int cmp = getCurrentLabel() - getTargetLabel();
  if (cmp < 0) {
   // seek forward
   //System.out.println("    seek fwd");
   break;
  } else if (cmp > 0) {
   // seek backwards -- reset this arc to the first arc
   final FST.Arc<T> arc = getArc(upto);
   fst.readFirstTargetArc(getArc(upto-1), arc, fstReader);
   //System.out.println("    seek first arc");
   break;
  }
  upto++;
 }
 //System.out.println("  fall through upto=" + upto);
}
origin: harbby/presto-connectors

protected void doNext() throws IOException {
 //System.out.println("FE: next upto=" + upto);
 if (upto == 0) {
  //System.out.println("  init");
  upto = 1;
  fst.readFirstTargetArc(getArc(0), getArc(1), fstReader);
 } else {
  // pop
  //System.out.println("  check pop curArc target=" + arcs[upto].target + " label=" + arcs[upto].label + " isLast?=" + arcs[upto].isLast());
  while (arcs[upto].isLast()) {
   upto--;
   if (upto == 0) {
    //System.out.println("  eof");
    return;
   }
  }
  fst.readNextArc(arcs[upto], fstReader);
 }
 pushFirst();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** doFloor controls the behavior of advance: if it's true
 *  doFloor is true, advance positions to the biggest
 *  term before target.  */
protected FSTEnum(FST<T> fst) {
 this.fst = fst;
 fstReader = fst.getBytesReader();
 NO_OUTPUT = fst.outputs.getNoOutput();
 fst.getFirstArc(getArc(0));
 output[0] = NO_OUTPUT;
}
origin: org.infinispan/infinispan-embedded-query

private void incr() {
 upto++;
 grow();
 if (arcs.length <= upto) {
  @SuppressWarnings({"rawtypes","unchecked"}) final FST.Arc<T>[] newArcs =
   new FST.Arc[ArrayUtil.oversize(1+upto, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];
  System.arraycopy(arcs, 0, newArcs, 0, arcs.length);
  arcs = newArcs;
 }
 if (output.length <= upto) {
  @SuppressWarnings({"rawtypes","unchecked"}) final T[] newOutput =
   (T[]) new Object[ArrayUtil.oversize(1+upto, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];
  System.arraycopy(output, 0, newOutput, 0, output.length);
  output = newOutput;
 }
}
origin: org.apache.lucene/lucene-core

rewindPrefix();
FST.Arc<T> arc = getArc(upto);
int targetLabel = getTargetLabel();
   setCurrentLabel(arc.label);
   incr();
   arc = fst.readFirstTargetArc(arc, getArc(upto), fstReader);
   targetLabel = getTargetLabel();
   continue;
  } else if (low == arc.numArcs) {
    final FST.Arc<T> prevArc = getArc(upto);
     pushFirst();
     return;
   fst.readNextRealArc(arc, in);
   assert arc.label > targetLabel;
   pushFirst();
   return;
   setCurrentLabel(arc.label);
   incr();
   arc = fst.readFirstTargetArc(arc, getArc(upto), fstReader);
   targetLabel = getTargetLabel();
  } else if (arc.label > targetLabel) {
   pushFirst();
   return;
origin: org.infinispan/infinispan-embedded-query

private void pushLast() throws IOException {
 FST.Arc<T> arc = arcs[upto];
 assert arc != null;
 while (true) {
  setCurrentLabel(arc.label);
  output[upto] = fst.outputs.add(output[upto-1], arc.output);
  if (arc.label == FST.END_LABEL) {
   // Final node
   break;
  }
  incr();
  arc = fst.readLastTargetArc(arc, getArc(upto), fstReader);
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** Rewinds enum state to match the shared prefix between
 *  current term and target term */
protected final void rewindPrefix() throws IOException {
 if (upto == 0) {
  //System.out.println("  init");
  upto = 1;
  fst.readFirstTargetArc(getArc(0), getArc(1), fstReader);
  return;
 }
 //System.out.println("  rewind upto=" + upto + " vs targetLength=" + targetLength);
 final int currentLimit = upto;
 upto = 1;
 while (upto < currentLimit && upto <= targetLength+1) {
  final int cmp = getCurrentLabel() - getTargetLabel();
  if (cmp < 0) {
   // seek forward
   //System.out.println("    seek fwd");
   break;
  } else if (cmp > 0) {
   // seek backwards -- reset this arc to the first arc
   final FST.Arc<T> arc = getArc(upto);
   fst.readFirstTargetArc(getArc(upto-1), arc, fstReader);
   //System.out.println("    seek first arc");
   break;
  }
  upto++;
 }
 //System.out.println("  fall through upto=" + upto);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

protected void doNext() throws IOException {
 //System.out.println("FE: next upto=" + upto);
 if (upto == 0) {
  //System.out.println("  init");
  upto = 1;
  fst.readFirstTargetArc(getArc(0), getArc(1), fstReader);
 } else {
  // pop
  //System.out.println("  check pop curArc target=" + arcs[upto].target + " label=" + arcs[upto].label + " isLast?=" + arcs[upto].isLast());
  while (arcs[upto].isLast()) {
   upto--;
   if (upto == 0) {
    //System.out.println("  eof");
    return;
   }
  }
  fst.readNextArc(arcs[upto], fstReader);
 }
 pushFirst();
}
origin: org.apache.lucene/lucene-core

/** Seeks to smallest term that's &gt;= target. */
public InputOutput<T> seekCeil(IntsRef target) throws IOException {
 this.target = target;
 targetLength = target.length;
 super.doSeekCeil();
 return setResult();
}
org.apache.lucene.util.fstFSTEnum

Javadoc

Can next() and advance() through the terms in an FST

Most used methods

  • doSeekCeil
    Seeks to smallest term that's >= target.
  • doSeekExact
    Seeks to exactly target term.
  • doSeekFloor
    Seeks to largest term that's <= target.
  • getArc
  • getCurrentLabel
  • getTargetLabel
  • grow
  • incr
  • pushFirst
  • pushLast
  • rewindPrefix
    Rewinds enum state to match the shared prefix between current term and target term
  • setCurrentLabel
  • rewindPrefix,
  • setCurrentLabel

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now