All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gw.util.science.Current.gs Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
package gw.util.science

uses gw.util.science.Charge //to prevent conflict with Guidewire's entity.Charge type
uses gw.util.Rational

uses java.math.RoundingMode
uses java.math.MathContext

final class Current extends AbstractMeasure {
  construct( value : Rational, unit: CurrentUnit, displayUnit: CurrentUnit ) {
    super( value, unit, displayUnit, CurrentUnit.BASE )
  }
  construct( value : Rational, unit: CurrentUnit ) {
    this( value, unit, unit )
  }

  function multiply( time: Time ) : Charge {
    return new Charge( toBaseNumber() * time.toBaseNumber(), ChargeUnit.Coulomb )
  }

  function divide( p: Potential ) : Conductance {
    return new Conductance( toBaseNumber() / p.toBaseNumber(), ConductanceUnit.BASE, ConductanceUnit.get( Unit, p.Unit ) )
  }
  function divide( c: Conductance ) : Potential {
    return new Potential( toBaseNumber() / c.toBaseNumber(), PotentialUnit.BASE, c.Unit.PotentialUnit )
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy