Package org.apache.uima.cas.impl
Class CasCompare.Prev
java.lang.Object
org.apache.uima.cas.impl.CasCompare.Prev
- Enclosing class:
CasCompare
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
FieldsModifier and TypeFieldDescriptionprivate intlength of the cycle, excluding any leading ref chain -1 until some cycle is detectedprivate intlength of the leading ref chain, excludes any cycle part -1 until some cycle is detectedordered list of traversed FSs, including duplicates(package private) TOPref to the top of the chain; used as a boolean flag -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) voidaddTop()(package private) voidclear()(package private) intcompareCycleLen(CasCompare.Prev other) (package private) intcompareUsize(CasCompare.Prev other) (package private) voidcalled 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 Details
-
fsList
ordered list of traversed FSs, including duplicates -
cycleLen
private int cycleLenlength of the cycle, excluding any leading ref chain -1 until some cycle is detected -
cycleStart
private int cycleStartlength of the leading ref chain, excludes any cycle part -1 until some cycle is detected -
prevCompareTop
TOP prevCompareTopref to the top of the chain; used as a boolean flag
-
-
Constructor Details
-
Prev
private Prev()
-
-
Method Details
-
clear
void clear() -
compareCycleLen
-
compareUsize
-
rmvLast
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
-
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
-