mavis
Class NormalizedValue

java.lang.Object
  extended by mavis.MeasurementValue<java.lang.Double>
      extended by mavis.NormalizedValue

abstract class NormalizedValue
extends MeasurementValue<java.lang.Double>

Specializes the MeasurementValue class with automatic value normalization.


Field Summary
 
Fields inherited from class mavis.MeasurementValue
DECLINATION, DIFFERENCE_DECLINATION, DIFFERENCE_GEOGRAPHIC_X, DIFFERENCE_GEOGRAPHIC_Y, DIFFERENCE_GEOGRAPHIC_Z, DIFFERENCE_INCLINATION, DIFFERENCE_MAGNETIZATION, DIFFERENCE_SAMPLE_X, DIFFERENCE_SAMPLE_Y, DIFFERENCE_SAMPLE_Z, GEOGRAPHIC_X, GEOGRAPHIC_X_NORMALIZED, GEOGRAPHIC_Y, GEOGRAPHIC_Y_NORMALIZED, GEOGRAPHIC_Z, GEOGRAPHIC_Z_NORMALIZED, INCLINATION, MAGNETIZATION, MOMENT, RELATIVE_MAGNETIZATION, SAMPLE_X, SAMPLE_X_NORMALIZED, SAMPLE_Y, SAMPLE_Y_NORMALIZED, SAMPLE_Z, SAMPLE_Z_NORMALIZED, SIGNAL_TO_DRIFT, SIGNAL_TO_HOLDER, SIGNAL_TO_NOISE, THETA63, ZIDJERVELD_X, ZIDJERVELD_X_NORMALIZED, ZIDJERVELD_Y, ZIDJERVELD_Y_NORMALIZED, ZIDJERVELD_Z, ZIDJERVELD_Z_NORMALIZED
 
Constructor Summary
NormalizedValue(java.lang.String caption, java.lang.String description)
           
 
Method Summary
 java.lang.String getUnit(Project project)
          Returns mA/m or Am^2/kg depending on the normalization that the project uses.
 java.lang.Double getValue(MeasurementStep step)
          Calculates a specific normalized value from a measurement step.
protected abstract  java.lang.Double getValue0(MeasurementStep step)
          Calculates a specific NOT NORMALIZED value from a measurement step.
private static java.lang.Double normalize(MeasurementStep step, java.lang.Double value)
          Normalizes a value by mass or volume, as specified in the project or step.
 
Methods inherited from class mavis.MeasurementValue
getCaption, getDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NormalizedValue

public NormalizedValue(java.lang.String caption,
                       java.lang.String description)
Method Detail

getValue

public final java.lang.Double getValue(MeasurementStep step)
Calculates a specific normalized value from a measurement step.

Specified by:
getValue in class MeasurementValue<java.lang.Double>
Parameters:
step - the step from which the value will be calculated.
Returns:
the calculated value, or null if it was not possible to calculate it. The unit is mA/m or Am^2/kg depenging on the normalization that was used.
Throws:
java.lang.NullPointerException - if step is null.

getValue0

protected abstract java.lang.Double getValue0(MeasurementStep step)
Calculates a specific NOT NORMALIZED value from a measurement step.

Parameters:
step - the step from which the value will be calculated.
Returns:
the calculated value, or null if it was not possible to calculate it. The unit is Am^2.
Throws:
java.lang.NullPointerException - if step is null.

getUnit

public java.lang.String getUnit(Project project)
Returns mA/m or Am^2/kg depending on the normalization that the project uses.

Overrides:
getUnit in class MeasurementValue<java.lang.Double>
Parameters:
project - the currently active project, or null if no project is active. Used for returning a different text depending on the project.

normalize

private static java.lang.Double normalize(MeasurementStep step,
                                          java.lang.Double value)
Normalizes a value by mass or volume, as specified in the project or step.

Parameters:
step - the step whose value is being normalized.
value - the value to be normalised. The unit is Am^2.
Returns:
the normalized value if the mass/volume was specified, otherwise the original un-normalized value, or null if errors occur. The unit is mAm^2 divided by m^3 or kg depending on the used normalization.