public int compareTo(Object o) {
if (!(o instanceof Segment)) {
return -1;
}
Segment s = (Segment) o;
// if regions overlap at all, declare the segments equal,
// to avoid overlap in the segment list
if (((s.endCode >= this.startCode) && (s.endCode <= this.endCode)) ||
((s.startCode >= this.startCode) && (s.startCode <= this.endCode))) {