public abstract class AbstractMetric extends Object implements IMetric
Constructor and Description |
---|
AbstractMetric() |
Modifier and Type | Method and Description |
---|---|
abstract double |
calculate(ISpectrum spectrum) |
boolean |
equals(Object obj) |
IFormula |
getFormula() |
abstract String |
getName() |
int |
hashCode() |
protected double |
log2(double value) |
protected double |
normalize(double value)
Normalize a value using Andrea's normalization function.
|
protected double |
normalize(double min,
double max,
double value)
Normalizes a value.
|
boolean |
requireFormula() |
void |
setFormula(IFormula formula) |
protected boolean |
validMatrix(ISpectrum spectrum) |
public abstract double calculate(ISpectrum spectrum)
public boolean requireFormula()
requireFormula
in interface IMetric
public void setFormula(IFormula formula)
setFormula
in interface IMetric
public IFormula getFormula()
getFormula
in interface IMetric
protected boolean validMatrix(ISpectrum spectrum)
spectrum
- protected double log2(double value)
value
- protected double normalize(double min, double max, double value)
min
- max
- value
- to normalizeprotected double normalize(double value) throws IllegalArgumentException
value
- a double.IllegalArgumentException
- if any.Copyright © 2010–2019 GZoltar. All rights reserved.