Tabnine Logo
MultiplyConverter.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
javax.measure.converter.MultiplyConverter
constructor

Best Java code snippets using javax.measure.converter.MultiplyConverter.<init> (Showing top 16 results out of 315)

origin: org.jscience/jscience

private static UnitConverter valueOf(double factor) {
  float asFloat = (float) factor;
  return asFloat == 1.0f ? UnitConverter.IDENTITY
      : new MultiplyConverter(factor);
}
origin: net.java.dev.jsr-275/jsr-275

private static UnitConverter valueOf(double factor) {
  float asFloat = (float) factor;
  return asFloat == 1.0f ? UnitConverter.IDENTITY
      : new MultiplyConverter(factor);
}
origin: mkulesh/microMathematics

private static UnitConverter valueOf(double factor) {
  float asFloat = (float) factor;
  return asFloat == 1.0f ? UnitConverter.IDENTITY
      : new MultiplyConverter(factor);
}
origin: mkulesh/microMathematics

@Override
public UnitConverter inverse() {
  return new MultiplyConverter(1.0 / _factor);
}
origin: org.jscience/jscience

@Override
public UnitConverter inverse() {
  return new MultiplyConverter(1.0 / _factor);
}
origin: net.java.dev.jsr-275/jsr-275

@Override
public UnitConverter inverse() {
  return new MultiplyConverter(1.0 / _factor);
}
origin: org.jscience/jscience

/**
 * Returns the result of dividing this unit by an approximate divisor.
 *
 * @param  divisor the approximate divisor.
 * @return <code>this.transform(new MultiplyConverter(1.0 / divisor))</code>
 */
public final Unit<Q> divide(double divisor) {
  return transform(new MultiplyConverter(1.0 / divisor));
}
origin: net.java.dev.jsr-275/jsr-275

/**
 * Returns the result of dividing this unit by an approximate divisor.
 *
 * @param  divisor the approximate divisor.
 * @return <code>this.transform(new MultiplyConverter(1.0 / divisor))</code>
 */
public final Unit<Q> divide(double divisor) {
  return transform(new MultiplyConverter(1.0 / divisor));
}
origin: net.java.dev.jsr-275/jsr-275

/**
 * Returns the result of multiplying this unit by a an approximate factor
 *
 * @param  factor the approximate factor (e.g. 
 *         <code>ELECTRON_MASS = KILOGRAM.times(9.10938188e-31)</code>).
 * @return <code>this.transform(new MultiplyConverter(factor))</code>
 */
public final Unit<Q> times(double factor) {
  return transform(new MultiplyConverter(factor));
}
origin: org.jscience/jscience

/**
 * Returns the result of multiplying this unit by a an approximate factor
 *
 * @param  factor the approximate factor (e.g. 
 *         <code>ELECTRON_MASS = KILOGRAM.times(9.10938188e-31)</code>).
 * @return <code>this.transform(new MultiplyConverter(factor))</code>
 */
public final Unit<Q> times(double factor) {
  return transform(new MultiplyConverter(factor));
}
origin: mkulesh/microMathematics

/**
 * Returns the result of multiplying this unit by a an approximate factor
 *
 * @param  factor the approximate factor (e.g. 
 *         <code>ELECTRON_MASS = KILOGRAM.times(9.10938188e-31)</code>).
 * @return <code>this.transform(new MultiplyConverter(factor))</code>
 */
public final Unit<Q> times(double factor) {
  return transform(new MultiplyConverter(factor));
}
origin: mkulesh/microMathematics

/**
 * Returns the result of dividing this unit by an approximate divisor.
 *
 * @param  divisor the approximate divisor.
 * @return <code>this.transform(new MultiplyConverter(1.0 / divisor))</code>
 */
public final Unit<Q> divide(double divisor) {
  return transform(new MultiplyConverter(1.0 / divisor));
}
origin: org.jscience/jscience

@Override
public UnitConverter concatenate(UnitConverter converter) {
  if (converter instanceof RationalConverter) {
    RationalConverter that = (RationalConverter) converter;
    long dividendLong = this._dividend * that._dividend;
    long divisorLong = this._divisor * that._divisor;
    double dividendDouble = ((double)this._dividend) * that._dividend;
    double divisorDouble = ((double)this._divisor) * that._divisor;
    if ((dividendLong != dividendDouble) || 
        (divisorLong != divisorDouble)) { // Long overflows.
      return new MultiplyConverter(dividendDouble / divisorDouble);
    }
    long gcd = gcd(dividendLong, divisorLong);
    return RationalConverter.valueOf(dividendLong / gcd, divisorLong / gcd);
  } else if (converter instanceof MultiplyConverter) {
    return converter.concatenate(this);
  } else {
    return super.concatenate(converter);
  }
}
origin: net.java.dev.jsr-275/jsr-275

@Override
public UnitConverter concatenate(UnitConverter converter) {
  if (converter instanceof RationalConverter) {
    RationalConverter that = (RationalConverter) converter;
    long dividendLong = this._dividend * that._dividend;
    long divisorLong = this._divisor * that._divisor;
    double dividendDouble = ((double)this._dividend) * that._dividend;
    double divisorDouble = ((double)this._divisor) * that._divisor;
    if ((dividendLong != dividendDouble) || 
        (divisorLong != divisorDouble)) { // Long overflows.
      return new MultiplyConverter(dividendDouble / divisorDouble);
    }
    long gcd = gcd(dividendLong, divisorLong);
    return RationalConverter.valueOf(dividendLong / gcd, divisorLong / gcd);
  } else if (converter instanceof MultiplyConverter) {
    return converter.concatenate(this);
  } else {
    return super.concatenate(converter);
  }
}
origin: mkulesh/microMathematics

@Override
public UnitConverter concatenate(UnitConverter converter) {
  if (converter instanceof RationalConverter) {
    RationalConverter that = (RationalConverter) converter;
    long dividendLong = this._dividend * that._dividend;
    long divisorLong = this._divisor * that._divisor;
    double dividendDouble = ((double)this._dividend) * that._dividend;
    double divisorDouble = ((double)this._divisor) * that._divisor;
    if ((dividendLong != dividendDouble) || 
        (divisorLong != divisorDouble)) { // Long overflows.
      return new MultiplyConverter(dividendDouble / divisorDouble);
    }
    long gcd = gcd(dividendLong, divisorLong);
    return RationalConverter.valueOf(dividendLong / gcd, divisorLong / gcd);
  } else if (converter instanceof MultiplyConverter) {
    return converter.concatenate(this);
  } else {
    return super.concatenate(converter);
  }
}
origin: org.qsardb.cargo/ucum

multiplier = new MultiplyConverter(-1);
multiplier = new MultiplyConverter(-1);
javax.measure.converterMultiplyConverter<init>

Javadoc

Creates a multiply converter with the specified scale factor.

Popular methods of MultiplyConverter

  • getFactor
    Returns the scale factor.
  • valueOf

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • putExtra (Intent)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JCheckBox (javax.swing)
  • JPanel (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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