Package tech.units.indriya.function
Class PowersOfPiConverter
java.lang.Object
tech.units.indriya.AbstractConverter
tech.units.indriya.function.PowersOfPiConverter
- All Implemented Interfaces:
Serializable,Comparable<javax.measure.UnitConverter>,javax.measure.UnitConverter
This class represents a converter multiplying numeric values by a factor of
Pi to the power of an integer exponent (π^exponent).
- Since:
- 2.0
- Version:
- 1.0, April 24, 2018
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tech.units.indriya.AbstractConverter
AbstractConverter.Pair -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleprivate final intprivate final intprivate static final longFields inherited from class tech.units.indriya.AbstractConverter
conversionSteps, IDENTITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(javax.measure.UnitConverter o) doubleconvertWhenNotIdentity(double value) Non-APIconvertWhenNotIdentity(BigDecimal value, MathContext ctx) Non-APIbooleanintinthashCode()Non-APIbooleanbooleanisLinear()protected booleanNon-API Guard forAbstractConverter.simpleCompose(AbstractConverter)static PowersOfPiConverterof(int exponent) Creates a converter with the specified exponent.protected AbstractConverterNon-API Guarded byAbstractConverter.isSimpleCompositionWith(AbstractConverter)final StringNon-APIMethods inherited from class tech.units.indriya.AbstractConverter
concatenate, convert, convert, convertWhenNotIdentity, getConversionSteps, inverse, of, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
exponent
private final int exponent -
hashCode
private final int hashCode -
doubleFactor
private final double doubleFactor
-
-
Constructor Details
-
PowersOfPiConverter
protected PowersOfPiConverter(int exponent)
-
-
Method Details
-
of
Creates a converter with the specified exponent.- Parameters:
exponent- the exponent for the factor π^exponent.
-
getExponent
public int getExponent() -
isIdentity
public boolean isIdentity() -
isLinear
public boolean isLinear() -
inverseWhenNotIdentity
Description copied from class:AbstractConverterNon-APIReturns an AbstractConverter that represents the inverse transformation of this converter, for cases where the transformation is not the identity transformation.
- Specified by:
inverseWhenNotIdentityin classAbstractConverter- Returns:
-
convertWhenNotIdentity
public BigDecimal convertWhenNotIdentity(BigDecimal value, MathContext ctx) throws ArithmeticException Description copied from class:AbstractConverterNon-API- Specified by:
convertWhenNotIdentityin classAbstractConverter- Parameters:
value-ctx-- Returns:
- transformed value
- Throws:
ArithmeticException
-
convertWhenNotIdentity
public double convertWhenNotIdentity(double value) Description copied from class:AbstractConverterNon-API- Specified by:
convertWhenNotIdentityin classAbstractConverter- Parameters:
value-- Returns:
- transformed value
-
isSimpleCompositionWith
Description copied from class:AbstractConverterNon-API Guard forAbstractConverter.simpleCompose(AbstractConverter)- Specified by:
isSimpleCompositionWithin classAbstractConverter- Parameters:
that-- Returns:
- whether or not a 'simple' composition of transformations is possible
-
simpleCompose
Description copied from class:AbstractConverterNon-API Guarded byAbstractConverter.isSimpleCompositionWith(AbstractConverter)- Overrides:
simpleComposein classAbstractConverter- Parameters:
that-- Returns:
- a new AbstractConverter that adds no additional conversion step
-
equals
- Specified by:
equalsin classAbstractConverter
-
transformationLiteral
Description copied from class:AbstractConverterNon-APIReturns a String describing the transformation that is represented by this converter. Contributes to converter's
toStringmethod. If null or emptytoStringoutput becomes simplified.- Specified by:
transformationLiteralin classAbstractConverter- Returns:
-
compareTo
public int compareTo(javax.measure.UnitConverter o) -
hashCode
public int hashCode()- Specified by:
hashCodein classAbstractConverter
-