// union to get window annotations that are overlapping with LookupToken
startCandidateSet.retainAll(endCandidateSet);
// find largest overlapping window annotation
LookupAnnotation largestWindowAnnot = null;
Iterator laItr = startCandidateSet.iterator();
while (laItr.hasNext())
{
LookupAnnotation tempLookupAnnot = (LookupAnnotation) laItr.next();
if ((largestWindowAnnot == null)
|| (tempLookupAnnot.getLength() > largestWindowAnnot.getLength()))
{
// now see if we can handle the size of this window (permutation
// wise)
int ltCount = getNumberOfListTokens(
ltStartOffsetMap,
ltEndOffsetMap,
ltListIndexMap,
tempLookupAnnot.getStartOffset(),
tempLookupAnnot.getEndOffset());
if ((ltCount <= iv_maxPermutationLevel) && (ltCount > 0))
{
largestWindowAnnot = tempLookupAnnot;
}