Package org.apache.uima.cas.impl
Class CasCompare.Prev
- java.lang.Object
-
- org.apache.uima.cas.impl.CasCompare.Prev
-
- Enclosing class:
- CasCompare
private static class CasCompare.Prev extends java.lang.Objecthold 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 intcycleLenlength of the cycle, excluding any leading ref chain -1 until some cycle is detectedprivate intcycleStartlength of the leading ref chain, excludes any cycle part -1 until some cycle is detectedprivate java.util.ArrayList<TOP>fsListordered list of traversed FSs, including duplicates(package private) TOPprevCompareTopref to the top of the chain; used as a boolean flag
-
Constructor Summary
Constructors Modifier Constructor Description privatePrev()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidadd(TOP fs)(package private) voidaddTop()(package private) voidclear()(package private) intcompareCycleLen(CasCompare.Prev other)(package private) intcompareUsize(CasCompare.Prev other)(package private) voidrmvLast(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.(package private) intsize()return size of ref chain including duplicates due to ref loops(package private) intusize()return -2 or the length of the cycle including 1 loop
-
-
-
Field Detail
-
fsList
private final java.util.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
-
-
Method Detail
-
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
-
-