Class FST.Arc<T>

java.lang.Object
org.apache.lucene.util.fst.FST.Arc<T>
Enclosing class:
FST<T>

public static final class FST.Arc<T> extends Object
Represents a single arc.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
    Helper methods to read the bit-table of a direct addressing node.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
     
    private long
    Start position in the FST.BytesReader of the presence bits for a direct addressing node, aka the bit-table
    private int
     
    private int
    First label of a direct addressing node.
    private byte
     
    private int
     
    private long
     
    private T
     
    private byte
     
    private int
     
    private T
     
    private long
     
    private int
    Index of the current label of a direct addressing node.
    private long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Arc()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Where we are in the array; only valid if bytesPerArc != 0.
    int
    Non-zero if this arc is part of a node with fixed length arcs, which means all arcs for the node are encoded with a fixed number of bytes so that we binary search or direct address.
    copyFrom(FST.Arc<T> other)
    Returns this
    (package private) int
    First label of a direct addressing node.
    (package private) boolean
    flag(int flag)
     
    byte
     
    boolean
     
    boolean
     
    int
     
    (package private) long
    Address (into the byte[]) of the next arc - only for list of variable length arc.
     
    byte
    Node header flags.
    int
    How many arcs; only valid if bytesPerArc != 0 (fixed length arcs).
     
    long
    Where the first arc in the array starts; only valid if bytesPerArc != 0
    long
    Ord/address to target node.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • label

      private int label
    • output

      private T output
    • target

      private long target
    • flags

      private byte flags
    • nextFinalOutput

      private T nextFinalOutput
    • nextArc

      private long nextArc
    • nodeFlags

      private byte nodeFlags
    • bytesPerArc

      private int bytesPerArc
    • posArcsStart

      private long posArcsStart
    • arcIdx

      private int arcIdx
    • numArcs

      private int numArcs
    • bitTableStart

      private long bitTableStart
      Start position in the FST.BytesReader of the presence bits for a direct addressing node, aka the bit-table
    • firstLabel

      private int firstLabel
      First label of a direct addressing node.
    • presenceIndex

      private int presenceIndex
      Index of the current label of a direct addressing node. While arcIdx is the current index in the label range, presenceIndex is its corresponding index in the list of actually present labels. It is equal to the number of bits set before the bit at arcIdx in the bit-table. This field is a cache to avoid to count bits set repeatedly when iterating the next arcs.
  • Constructor Details

    • Arc

      public Arc()
  • Method Details

    • copyFrom

      public FST.Arc<T> copyFrom(FST.Arc<T> other)
      Returns this
    • flag

      boolean flag(int flag)
    • isLast

      public boolean isLast()
    • isFinal

      public boolean isFinal()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • label

      public int label()
    • output

      public T output()
    • target

      public long target()
      Ord/address to target node.
    • flags

      public byte flags()
    • nextFinalOutput

      public T nextFinalOutput()
    • nextArc

      long nextArc()
      Address (into the byte[]) of the next arc - only for list of variable length arc. Or ord/address to the next node if label == FST.END_LABEL.
    • arcIdx

      public int arcIdx()
      Where we are in the array; only valid if bytesPerArc != 0.
    • nodeFlags

      public byte nodeFlags()
      Node header flags. Only meaningful to check if the value is either FST.ARCS_FOR_BINARY_SEARCH or FST.ARCS_FOR_DIRECT_ADDRESSING or FST.ARCS_FOR_CONTINUOUS (other value when bytesPerArc == 0).
    • posArcsStart

      public long posArcsStart()
      Where the first arc in the array starts; only valid if bytesPerArc != 0
    • bytesPerArc

      public int bytesPerArc()
      Non-zero if this arc is part of a node with fixed length arcs, which means all arcs for the node are encoded with a fixed number of bytes so that we binary search or direct address. We do when there are enough arcs leaving one node. It wastes some bytes but gives faster lookups.
    • numArcs

      public int numArcs()
      How many arcs; only valid if bytesPerArc != 0 (fixed length arcs). For a node designed for binary search this is the array size. For a node designed for direct addressing, this is the label range.
    • firstLabel

      int firstLabel()
      First label of a direct addressing node. Only valid if nodeFlags == FST.ARCS_FOR_DIRECT_ADDRESSING or FST.ARCS_FOR_CONTINUOUS.