congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ScaledUnit.getDerivedUnit
Code IndexAdd Tabnine to your IDE (free)

How to use
getDerivedUnit
method
in
ucar.units.ScaledUnit

Best Java code snippets using ucar.units.ScaledUnit.getDerivedUnit (Showing top 12 results out of 315)

origin: edu.ucar/udunits

/**
 * Converts a numeric value from this unit to the underlying derived unit.
 * 
 * @param amount
 *            The numeric value in this unit.
 * @return The equivalent value in the underlying derived unit.
 * @throws ConversionException
 *             Can't convert value to the underlying derived unit.
 */
public double toDerivedUnit(final double amount) throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(this, getDerivedUnit());
  }
  return ((DerivableUnit) _unit).toDerivedUnit(amount * getScale());
}
origin: org.lasersonlab.thredds/udunits

/**
 * Converts a numeric value from this unit to the underlying derived unit.
 * 
 * @param amount
 *            The numeric value in this unit.
 * @return The equivalent value in the underlying derived unit.
 * @throws ConversionException
 *             Can't convert value to the underlying derived unit.
 */
public double toDerivedUnit(final double amount) throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(this, getDerivedUnit());
  }
  return ((DerivableUnit) _unit).toDerivedUnit(amount * getScale());
}
origin: edu.ucar/udunits

/**
 * Converts a numeric value from the underlying derived unit to this unit.
 * 
 * @param amount
 *            The numeric value in the underlying derived unit.
 * @return The equivalent value in this unit.
 * @throws ConversionException
 *             Can't convert value.
 */
public double fromDerivedUnit(final double amount)
    throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(getDerivedUnit(), this);
  }
  return ((DerivableUnit) getUnit()).fromDerivedUnit(amount) / getScale();
}
origin: org.lasersonlab.thredds/udunits

/**
 * Converts a numeric value from the underlying derived unit to this unit.
 * 
 * @param amount
 *            The numeric value in the underlying derived unit.
 * @return The equivalent value in this unit.
 * @throws ConversionException
 *             Can't convert value.
 */
public double fromDerivedUnit(final double amount)
    throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(getDerivedUnit(), this);
  }
  return ((DerivableUnit) getUnit()).fromDerivedUnit(amount) / getScale();
}
origin: org.lasersonlab.thredds/udunits

/**
 * Converts numeric values from this unit to the underlying derived unit.
 * 
 * @param input
 *            The numeric values in this unit.
 * @param output
 *            The equivalent values in the underlying derived unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values to the underlying derived unit.
 */
public float[] toDerivedUnit(final float[] input, final float[] output)
    throws ConversionException {
  final float scale = (float) getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] = input[i] * scale;
  }
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(this, getDerivedUnit());
  }
  return ((DerivableUnit) getUnit()).toDerivedUnit(output, output);
}
origin: edu.ucar/udunits

/**
 * Converts numeric values from the underlying derived unit to this unit.
 * 
 * @param input
 *            The numeric values in the underlying derived unit.
 * @param output
 *            The equivalent values in this unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values.
 */
public float[] fromDerivedUnit(final float[] input, final float[] output)
    throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(getDerivedUnit(), this);
  }
  ((DerivableUnit) getUnit()).fromDerivedUnit(input, output);
  final float scale = (float) getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] /= scale;
  }
  return output;
}
origin: org.lasersonlab.thredds/udunits

/**
 * Converts numeric values from this unit to the underlying derived unit.
 * 
 * @param input
 *            The numeric values in this unit.
 * @param output
 *            The equivalent values in the underlying derived unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values to the underlying derived unit.
 */
public double[] toDerivedUnit(final double[] input, final double[] output)
    throws ConversionException {
  final double scale = getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] = input[i] * scale;
  }
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(this, getDerivedUnit());
  }
  return ((DerivableUnit) getUnit()).toDerivedUnit(output, output);
}
origin: edu.ucar/udunits

/**
 * Converts numeric values from this unit to the underlying derived unit.
 * 
 * @param input
 *            The numeric values in this unit.
 * @param output
 *            The equivalent values in the underlying derived unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values to the underlying derived unit.
 */
public double[] toDerivedUnit(final double[] input, final double[] output)
    throws ConversionException {
  final double scale = getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] = input[i] * scale;
  }
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(this, getDerivedUnit());
  }
  return ((DerivableUnit) getUnit()).toDerivedUnit(output, output);
}
origin: org.lasersonlab.thredds/udunits

/**
 * Converts numeric values from the underlying derived unit to this unit.
 * 
 * @param input
 *            The numeric values in the underlying derived unit.
 * @param output
 *            The equivalent values in this unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values.
 */
public double[] fromDerivedUnit(final double[] input, final double[] output)
    throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(getDerivedUnit(), this);
  }
  ((DerivableUnit) getUnit()).fromDerivedUnit(input, output);
  final double scale = getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] /= scale;
  }
  return output;
}
origin: edu.ucar/udunits

/**
 * Converts numeric values from this unit to the underlying derived unit.
 * 
 * @param input
 *            The numeric values in this unit.
 * @param output
 *            The equivalent values in the underlying derived unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values to the underlying derived unit.
 */
public float[] toDerivedUnit(final float[] input, final float[] output)
    throws ConversionException {
  final float scale = (float) getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] = input[i] * scale;
  }
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(this, getDerivedUnit());
  }
  return ((DerivableUnit) getUnit()).toDerivedUnit(output, output);
}
origin: edu.ucar/udunits

/**
 * Converts numeric values from the underlying derived unit to this unit.
 * 
 * @param input
 *            The numeric values in the underlying derived unit.
 * @param output
 *            The equivalent values in this unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values.
 */
public double[] fromDerivedUnit(final double[] input, final double[] output)
    throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(getDerivedUnit(), this);
  }
  ((DerivableUnit) getUnit()).fromDerivedUnit(input, output);
  final double scale = getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] /= scale;
  }
  return output;
}
origin: org.lasersonlab.thredds/udunits

/**
 * Converts numeric values from the underlying derived unit to this unit.
 * 
 * @param input
 *            The numeric values in the underlying derived unit.
 * @param output
 *            The equivalent values in this unit.
 * @return <code>output</code>.
 * @throws ConversionException
 *             Can't convert values.
 */
public float[] fromDerivedUnit(final float[] input, final float[] output)
    throws ConversionException {
  if (!(_unit instanceof DerivableUnit)) {
    throw new ConversionException(getDerivedUnit(), this);
  }
  ((DerivableUnit) getUnit()).fromDerivedUnit(input, output);
  final float scale = (float) getScale();
  for (int i = input.length; --i >= 0;) {
    output[i] /= scale;
  }
  return output;
}
ucar.unitsScaledUnitgetDerivedUnit

Javadoc

Gets the derived unit underlying this unit.

Popular methods of ScaledUnit

  • getScale
    Returns the multiplicative factor.
  • getUnit
    Returns the reference unit.
  • <init>
    Constructs from a multiplicative factor, a reference unit, and an identifier.
  • equals
    Indicates if this unit is semantically identical to an object.
  • fromDerivedUnit
    Converts numeric values from the underlying derived unit to this unit.
  • getCanonicalString
    Returns the canonical string representation of the unit.
  • getInstance
  • isDimensionless
    Indicates if this unit is dimensionless. A ScaledUnit is dimensionless if and only if the reference
  • multiplyBy
  • raiseTo
  • toDerivedUnit
    Converts numeric values from this unit to the underlying derived unit.
  • divideBy
  • toDerivedUnit,
  • divideBy

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • JCheckBox (javax.swing)
  • JPanel (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now