Class FST.Arc<T>

  • Enclosing class:
    FST<T>

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

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  FST.Arc.BitTable
      Reusable table of bits using an array of long internally.
    • Constructor Summary

      Constructors 
      Constructor Description
      Arc()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int arcIdx()
      Where we are in the array; only valid if bytesPerArc != 0.
      (package private) FST.Arc.BitTable bitTable()
      Table of bits of a direct addressing node.
      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.
      FST.Arc<T> copyFrom​(FST.Arc<T> other)
      Returns this
      (package private) int firstLabel()
      First label of a direct addressing node.
      (package private) boolean flag​(int flag)  
      byte flags()  
      (package private) FST.Arc.BitTable getOrCreateBitTable()
      The table of bits of a direct addressing node created lazily.
      boolean isFinal()  
      boolean isLast()  
      int label()  
      (package private) long nextArc()
      Address (into the byte[]) of the next arc - only for list of variable length arc.
      T nextFinalOutput()  
      byte nodeFlags()
      Node header flags.
      int numArcs()
      How many arcs; only valid if bytesPerArc != 0 (fixed length arcs).
      T output()  
      long posArcsStart()
      Where the first arc in the array starts; only valid if bytesPerArc != 0
      long target()
      Ord/address to target node.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • label

        private int label
      • output

        private T output
      • target

        private long target
      • flags

        private byte flags
      • nextFinalOutput

        private T nextFinalOutput
      • nextArc

        private long nextArc
      • arcIdx

        private int arcIdx
      • nodeFlags

        private byte nodeFlags
      • posArcsStart

        private long posArcsStart
      • bytesPerArc

        private int bytesPerArc
      • numArcs

        private int numArcs
      • firstLabel

        private int firstLabel
    • Constructor Detail

      • Arc

        public Arc()
    • Method Detail

      • flag

        boolean flag​(int flag)
      • isLast

        public boolean isLast()
      • isFinal

        public boolean isFinal()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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.
      • 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.
      • getOrCreateBitTable

        FST.Arc.BitTable getOrCreateBitTable()
        The table of bits of a direct addressing node created lazily.