# Interface SAMRecordComparator

All Superinterfaces:
  `Comparator<SAMRecord>`

All Known Implementing Classes:
  `SAMRecordCoordinateComparator, SAMRecordDuplicateComparator, SAMRecordQueryHashComparator, SAMRecordQueryNameComparator`

public interface SAMRecordComparator extends Comparator<SAMRecord>
Interface for comparators that define the various SAM sort orders.

## Method Summary

Modifier and Type
Method
Description
`int`
`fileOrderCompare(SAMRecord samRecord1, SAMRecord samRecord2)`
Less stringent compare method than the regular compare.

### Methods inherited from interface Comparator

`compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

## Method Details

### fileOrderCompare

int fileOrderCompare(SAMRecord samRecord1, SAMRecord samRecord2)
Less stringent compare method than the regular compare. If the two records are equal enough that their ordering in a sorted SAM file would be arbitrary, this method returns 0.

Returns:
  negative if `samRecord1 < samRecord2`, 0 if equal, else positive