Package ghidra.program.util

# Class ProgramLocationComparator

java.lang.Object
ghidra.program.util.ProgramLocationComparator

All Implemented Interfaces:
  `Comparator<ProgramLocation>`

public class ProgramLocationComparator extends Object implements Comparator<ProgramLocation>
A comparator for the common fields of `ProgramLocation`

This comparator only compares the program, address, and class of the program location. To compare at greater granularity, invoke the `ProgramLocation.compareTo(ProgramLocation)` method, or use the natural ordering. Each particular type of location uses this comparator, and then compares the more detailed fields, if necessary. If this comparator indicates equality, then the two locations are definitely of the same class.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final ProgramLocationComparator`
  `INSTANCE`
  The singleton instance

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compare(ProgramLocation loc1, ProgramLocation loc2)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.Comparator

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

- ## Field Details

  - ### INSTANCE

    public static final ProgramLocationComparator INSTANCE
    The singleton instance

- ## Method Details

  - ### compare

    public int compare(ProgramLocation loc1, ProgramLocation loc2)
    Specified by:
      `compare` in interface `Comparator<ProgramLocation>`