Package PamUtils
Class FrequencyFormat
java.lang.Object
PamUtils.FrequencyFormat
A set of static functions for formatting frequency values in a common way,
i.e. if it's relatively low, do it in Hz, it it's high, do it in kHz;
- Author:
- Doug Gillespie
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatFrequency
(double frequency, boolean includeUnits) Format a frequency value.static String
formatFrequencyRange
(double[] frequency, boolean includeUnits) Format a frequency range.static FrequencyFormat
getFrequencyFormat
(double frequency) Get everything you need to format a frequency string in a standard way.double
getScale()
-
Method Details
-
formatFrequency
Format a frequency value.- Parameters:
frequency
- frequency in HzincludeUnits
- flag to include units (Hz or kHz)- Returns:
- formatted string
-
formatFrequencyRange
Format a frequency range.- Parameters:
frequency
- array of frequency values in Hz.includeUnits
- flag to include units (Hz or kHz)- Returns:
- formatted string
-
getFrequencyFormat
Get everything you need to format a frequency string in a standard way.- Parameters:
frequency
-- Returns:
- Frequency format object containing a format string for the number, a unit (Hz or kHz) and a scale factor to divide the raw Hz value down by (1 or 1000).
-
getNumberFormat
- Returns:
- the numberFormat
-
getUnitText
- Returns:
- the unitText
-
getScale
public double getScale()- Returns:
- the scale
-