Class CasCompare.Prev

java.lang.Object
org.apache.uima.cas.impl.CasCompare.Prev
Enclosing class:
CasCompare

private static class CasCompare.Prev extends Object
hold info about previous compares, to break cycles in references The comparison records cycles and can distinguish different cyclic graphs. When a cycle exists, it looks like: a b c d e f g h i a cycle starting with a, with refs ending up at i ^ v and then looping back to f *-----* This data structure measures both the cycle Length (in this example, 4) and the size of the starting part before hitting the loop (in this case 5) Note: when using, if two FSs end up comparing equal, the instances must be rolled back 1 item to allow further items to be compared in the chain. Example: a -> b -> c -> d d's compared equal, c may have ref next to "e".
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    length of the cycle, excluding any leading ref chain -1 until some cycle is detected
    private int
    length of the leading ref chain, excludes any cycle part -1 until some cycle is detected
    private final ArrayList<TOP>
    ordered list of traversed FSs, including duplicates
    (package private) TOP
    ref to the top of the chain; used as a boolean flag
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    add(TOP fs)
     
    (package private) void
     
    (package private) void
     
    (package private) int
     
    (package private) int
     
    (package private) void
    called when returning from compare with equal result If a loop exists, and the item being removed is the one that started the loopback, reset the loop info.
    (package private) int
    return size of ref chain including duplicates due to ref loops
    (package private) int
    return -2 or the length of the cycle including 1 loop

    Methods inherited from class java.lang.Object

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

    • fsList

      private final ArrayList<TOP> fsList
      ordered list of traversed FSs, including duplicates
    • cycleLen

      private int cycleLen
      length of the cycle, excluding any leading ref chain -1 until some cycle is detected
    • cycleStart

      private int cycleStart
      length of the leading ref chain, excludes any cycle part -1 until some cycle is detected
    • prevCompareTop

      TOP prevCompareTop
      ref to the top of the chain; used as a boolean flag
  • Constructor Details

    • Prev

      private Prev()
  • Method Details

    • clear

      void clear()
    • compareCycleLen

      int compareCycleLen(CasCompare.Prev other)
    • compareUsize

      int compareUsize(CasCompare.Prev other)
    • rmvLast

      void rmvLast(TOP fs)
      called when returning from compare with equal result If a loop exists, and the item being removed is the one that started the loopback, reset the loop info.
      Parameters:
      fs -
    • addTop

      void addTop()
    • add

      void add(TOP fs)
    • size

      int size()
      return size of ref chain including duplicates due to ref loops
    • usize

      int usize()
      return -2 or the length of the cycle including 1 loop