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 int
length of the cycle, excluding any leading ref chain -1 until some cycle is detectedprivate int
length of the leading ref chain, excludes any cycle part -1 until some cycle is detectedordered list of traversed FSs, including duplicates(package private) TOP
ref to the top of the chain; used as a boolean flag -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
(package private) void
addTop()
(package private) void
clear()
(package private) int
compareCycleLen
(CasCompare.Prev other) (package private) int
compareUsize
(CasCompare.Prev other) (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
size()
return size of ref chain including duplicates due to ref loops(package private) int
usize()
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
-