- All Implemented Interfaces:
- SAMRecordComparator, java.io.Serializable, java.util.Comparator<SAMRecord>
public class SAMRecordCoordinateComparator
extends java.lang.Object
implements SAMRecordComparator, java.io.Serializable
Comparator for sorting SAMRecords by coordinate. Note that the header is required because
the order of sequences in the header defines the major sort order.
Ideally this method would only return 0 for completely equal SAMRecords, so that sort is
completely deterministic. This implementation does not achieve this completely, but it
comes pretty close, while avoiding decoding the variable length fields, except for read name,
which is decoded if coordinate and strand are equal.
Extreme care must be taken to ensure the following:
if A == B, then B == A
if A < B, then B > A
if A < B && B < C, then A < C
- See Also:
- Serialized Form