100 |
public int compareTo(Object o) |
public int compareTo(Object o) |
101 |
{ |
{ |
102 |
if (o instanceof Integer) |
if (o instanceof Integer) |
103 |
{ |
{ |
104 |
int otherMark = ((Integer) o).intValue(); |
int otherMark = ((Integer) o).intValue(); |
105 |
return mark - otherMark; |
return mark - otherMark; |
106 |
} |
} |
107 |
else |
else |
108 |
{ |
{ |
109 |
GapContentPosition other = (GapContentPosition) o; |
GapContentPosition other = (GapContentPosition) o; |
110 |
return mark - other.mark; |
return mark - other.mark; |
111 |
} |
} |
112 |
} |
} |
113 |
|
|
114 |
/** |
/** |
644 |
new GapContentPosition(offset)); |
new GapContentPosition(offset)); |
645 |
if (index1 < 0) |
if (index1 < 0) |
646 |
index1 = -(index1 + 1); |
index1 = -(index1 + 1); |
647 |
|
|
648 |
|
// Search the first index with the specified offset. The binarySearch does |
649 |
|
// not necessarily find the first one. |
650 |
|
while (index1 > 0 |
651 |
|
&& ((GapContentPosition) positions.get(index1 - 1)).mark == offset) |
652 |
|
index1--; |
653 |
|
|
654 |
for (ListIterator i = positions.listIterator(index1); i.hasNext();) |
for (ListIterator i = positions.listIterator(index1); i.hasNext();) |
655 |
{ |
{ |
656 |
GapContentPosition p = (GapContentPosition) i.next(); |
GapContentPosition p = (GapContentPosition) i.next(); |
679 |
new GapContentPosition(offset)); |
new GapContentPosition(offset)); |
680 |
if (index1 < 0) |
if (index1 < 0) |
681 |
index1 = -(index1 + 1); |
index1 = -(index1 + 1); |
682 |
|
|
683 |
|
// Search the first index with the specified offset. The binarySearch does |
684 |
|
// not necessarily find the first one. |
685 |
|
while (index1 > 0 |
686 |
|
&& ((GapContentPosition) positions.get(index1 - 1)).mark == offset) |
687 |
|
index1--; |
688 |
|
|
689 |
for (ListIterator i = positions.listIterator(index1); i.hasNext();) |
for (ListIterator i = positions.listIterator(index1); i.hasNext();) |
690 |
{ |
{ |
691 |
GapContentPosition p = (GapContentPosition) i.next(); |
GapContentPosition p = (GapContentPosition) i.next(); |
714 |
new GapContentPosition(offset)); |
new GapContentPosition(offset)); |
715 |
if (index1 < 0) |
if (index1 < 0) |
716 |
index1 = -(index1 + 1); |
index1 = -(index1 + 1); |
717 |
|
|
718 |
|
// Search the first index with the specified offset. The binarySearch does |
719 |
|
// not necessarily find the first one. |
720 |
|
while (index1 > 0 |
721 |
|
&& ((GapContentPosition) positions.get(index1 - 1)).mark == offset) |
722 |
|
index1--; |
723 |
for (ListIterator i = positions.listIterator(index1); i.hasNext();) |
for (ListIterator i = positions.listIterator(index1); i.hasNext();) |
724 |
{ |
{ |
725 |
GapContentPosition p = (GapContentPosition) i.next(); |
GapContentPosition p = (GapContentPosition) i.next(); |