## gov.usgs.earthquake.event
Class JsonEventInfoComparator

    java.lang.Object
      gov.usgs.earthquake.event.JsonEventInfoComparator

All Implemented Interfaces:
  java.util.Comparator<JsonEventInfo>

    public class JsonEventInfoComparator

extends java.lang.Object
implements java.util.Comparator<JsonEventInfo>

Provides an ordering for events, based on "euclidean" distance from a reference event.

Constructor Summary
`JsonEventInfoComparator(EventSanityCheck sanityRules, EventInfo referenceEvent)` Construct a new EventInfoComparator.

Method Summary
`int` `compare(JsonEventInfo event1, JsonEventInfo event2)` Compare two events against the reference event.

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`

Constructor Detail

### JsonEventInfoComparator

    public JsonEventInfoComparator(EventSanityCheck sanityRules,
                                   EventInfo referenceEvent)

  Construct a new EventInfoComparator.

  Parameters:
    `sanityRules` - determines "euclidean" distance.
    `referenceEvent` - main event other events are compared agains.

Method Detail

### compare

    public int compare(JsonEventInfo event1,
                       JsonEventInfo event2)

  Compare two events against the reference event.

  Specified by:
    `compare` in interface `java.util.Comparator<JsonEventInfo>`