Class CasSeqAddrMaps

java.lang.Object
org.apache.uima.cas.impl.CasSeqAddrMaps

public class CasSeqAddrMaps extends Object
Manage the conversion of Items (FSrefs) to relative sequential index number, and back Manage the difference in two type systems both size of the FSs and handling excluded types During serialization, these maps are constructed before serialization. During deserialization, these maps are constructed while things are being deserialized, and then used in a "fixup" call at the end. This allows for forward references. For delta deserialization, the base part of these maps (for below-the-line) is constructed by scanning up to the mark.
  • Field Details

    • tgtSeq2SrcAddr

      private final IntVector tgtSeq2SrcAddr
      map from a target FS sequence nbr to a source address. value is 0 if the target instance doesn't exist in the source (this doesn't occur for receiving remote CASes back (because src ts is always a superset of tgt ts), but can occur while deserializing from Disk. First seq number is 0.
    • srcAddr2TgtSeq

      private final Int2IntRBT srcAddr2TgtSeq
      map from source address to target sequence number. if source is not in target, value = -1;
    • nextTgt

      private int nextTgt
      Indexed by AuxHeap kind:
  • Constructor Details

    • CasSeqAddrMaps

      public CasSeqAddrMaps()
    • CasSeqAddrMaps

      public CasSeqAddrMaps(IntVector tgtSeq2SrcAddr, Int2IntRBT srcAddr2TgtSeq)
  • Method Details

    • addItemAddr

      public void addItemAddr(int srcAddr, int tgtAddr, boolean inTarget)
      Add a new FS address - done during prescan of source Must call in heap scan order
      Parameters:
      srcAddr - -
      tgtAddr - -
      inTarget - true if this type is in the target
    • addSrcAddrForTgt

      public void addSrcAddrForTgt(int srcAddr, boolean inSrc)
      Called during deserialize to incrementally add
      Parameters:
      srcAddr - -
      inSrc - -
    • getSrcAddrFromTgtSeq

      public int getSrcAddrFromTgtSeq(int seq)
      Parameters:
      seq - -
      Returns:
      0 means target seq doesn't exist in source CAS
    • getTgtSeqFromSrcAddr

      public int getTgtSeqFromSrcAddr(int itemAddr)
      Parameters:
      itemAddr - -
      Returns:
      -1 if src addr not in target seq
    • getNumberSrcFss

      public int getNumberSrcFss()
    • copy