# Class MetricBase

java.lang.Object
htsjdk.samtools.metrics.MetricBase

Direct Known Subclasses:
  `SamFileValidator.ValidationMetrics`

public class MetricBase extends Object
A base class from which all Metric classes should inherit.

## Constructor Summary

Constructors
Constructor
Description
`MetricBase()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
An equals method that checks equality by asserting that the classes are of the exact same type and that all public fields are equivalent.
`int`
`hashCode()`
Computes a hashcode by formatting each field into its on disk representation and summing the hashcodes of all the fields.
`String`
`toString()`
Converts the metric class to a human readable string.

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### MetricBase

public MetricBase()

## Method Details

### equals

public boolean equals(Object o)
An equals method that checks equality by asserting that the classes are of the exact same type and that all public fields are equivalent. Equivalence is checked by formatting the field as it would be written to disk and then checking String equality.

Overrides:
  `equals` in class `Object`
Parameters:
  `o` - an instance to compare to
Returns:
  true if they are equal, false otherwise

### hashCode

public int hashCode()
Computes a hashcode by formatting each field into its on disk representation and summing the hashcodes of all the fields.

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()
Converts the metric class to a human readable string.

Overrides:
  `toString` in class `Object`