public final class UnitPrefix
extends java.lang.Object
LinearUnit
to multiply it by some valueModifier and Type | Method and Description |
---|---|
UnitPrefix |
dividedBy(double divisor)
Divides this prefix by a scalar
|
UnitPrefix |
dividedBy(UnitPrefix other)
Divides this prefix by
other . |
boolean |
equals(java.lang.Object obj)
Uses the prefix's multiplier to determine equality.
|
double |
getMultiplier() |
java.util.Set<java.lang.String> |
getOtherNames() |
java.util.Optional<java.lang.String> |
getPrimaryName() |
java.util.Optional<java.lang.String> |
getSymbol() |
int |
hashCode()
Uses the prefix's multiplier to determine a hash code.
|
UnitPrefix |
times(double multiplicand)
Multiplies this prefix by a scalar
|
UnitPrefix |
times(UnitPrefix other)
Multiplies this prefix by
other . |
UnitPrefix |
toExponent(double exponent)
Raises this prefix to an exponent.
|
java.lang.String |
toString() |
static UnitPrefix |
valueOf(double multiplier)
Gets a
UnitPrefix from a multiplier |
static UnitPrefix |
valueOf(double multiplier,
NameSymbol ns)
Gets a
UnitPrefix from a multiplier and a name |
UnitPrefix |
withName(NameSymbol ns) |
public static UnitPrefix valueOf(double multiplier)
UnitPrefix
from a multipliermultiplier
- multiplier of prefixpublic static UnitPrefix valueOf(double multiplier, NameSymbol ns)
UnitPrefix
from a multiplier and a namemultiplier
- multiplier of prefixns
- name(s) and symbol of prefixjava.lang.NullPointerException
- if ns is nullpublic UnitPrefix dividedBy(double divisor)
divisor
- number to divide bypublic UnitPrefix dividedBy(UnitPrefix other)
other
.other
- prefix to divide bypublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public double getMultiplier()
public final java.util.Set<java.lang.String> getOtherNames()
public final java.util.Optional<java.lang.String> getPrimaryName()
public final java.util.Optional<java.lang.String> getSymbol()
public int hashCode()
hashCode
in class java.lang.Object
public UnitPrefix times(double multiplicand)
multiplicand
- number to multiply bypublic UnitPrefix times(UnitPrefix other)
other
.other
- prefix to multiply bypublic UnitPrefix toExponent(double exponent)
exponent
- exponent to raise topublic java.lang.String toString()
toString
in class java.lang.Object
public UnitPrefix withName(NameSymbol ns)
ns
- name(s) and symbol to usejava.lang.NullPointerException
- if ns is null