public class Unit extends Object
Unit object containing relationship to SI base units.
Modifier and Type | Field and Description |
---|---|
protected double |
ampere |
protected double |
candela |
protected String |
code |
protected String |
description |
protected String |
expression |
protected UnitFunction |
function |
protected double |
kelvin |
protected double |
kilogram |
protected double |
meter |
protected boolean |
metric |
protected double |
mole |
protected String |
name |
protected double |
pi |
protected String |
printSymbol |
protected String |
property |
protected double |
radian |
protected double |
scaleToSI |
protected double |
second |
Constructor and Description |
---|
Unit() |
Modifier and Type | Method and Description |
---|---|
Unit |
copy()
Copies this unit integrally
|
double |
getAmpere() |
double |
getCandela() |
String |
getCode() |
Unit |
getCompatibleSIUnit() |
String |
getDescription() |
String |
getExpression() |
UnitFunction |
getFunction() |
double |
getKelvin() |
double |
getKilogram() |
double |
getMeter() |
double |
getMole() |
String |
getName() |
double |
getPi() |
String |
getPrintSymbol() |
String |
getProperty() |
double |
getRadian() |
double |
getScaleToSI() |
double |
getSecond() |
String |
getUCUMExpression() |
boolean |
isCompatible(Unit unit)
Checks that this unit is physically compatible with the
given unit, which also means that it is possible to
convert from one to the other and vice versa.
|
boolean |
isEquivalent(Unit unit) |
boolean |
isMetric() |
void |
multiply(double scale) |
void |
multiply(Unit unit)
Multiply this unit by another unit to generate a complex unit
|
void |
power(double power)
Raises this unit to the given power, thus modifying
all powers of metric base SI coefs.
|
void |
setAmpere(double ampere) |
void |
setCandela(double candela) |
void |
setCode(String code) |
void |
setDescription(String description) |
void |
setExpression(String expression) |
void |
setFunction(UnitFunction function) |
void |
setKelvin(double kelvin) |
void |
setKilogram(double kilogram) |
void |
setMeter(double meter) |
void |
setMetric(boolean metric) |
void |
setMole(double mole) |
void |
setName(String name) |
void |
setPi(double pi) |
void |
setPrintSymbol(String symbol) |
void |
setProperty(String property) |
void |
setRadian(double radian) |
void |
setScaleToSI(double scaleToSI) |
void |
setSecond(double second) |
String |
toString() |
protected String name
protected String code
protected String printSymbol
protected String property
protected String description
protected String expression
protected double meter
protected double kilogram
protected double second
protected double ampere
protected double kelvin
protected double mole
protected double candela
protected double radian
protected double pi
protected double scaleToSI
protected boolean metric
protected UnitFunction function
public Unit copy()
public boolean isCompatible(Unit unit)
unit
- public boolean isEquivalent(Unit unit)
unit
- public void power(double power)
power
- public void multiply(Unit unit)
unit
- public Unit getCompatibleSIUnit()
public void multiply(double scale)
public String getName()
public void setName(String name)
public String getCode()
public void setCode(String code)
public String getPrintSymbol()
public void setPrintSymbol(String symbol)
public String getExpression()
public void setExpression(String expression)
public String getProperty()
public void setProperty(String property)
public String getDescription()
public void setDescription(String description)
public boolean isMetric()
public void setMetric(boolean metric)
public double getAmpere()
public void setAmpere(double ampere)
public double getCandela()
public void setCandela(double candela)
public double getKelvin()
public void setKelvin(double kelvin)
public double getKilogram()
public void setKilogram(double kilogram)
public double getMeter()
public void setMeter(double meter)
public double getMole()
public void setMole(double mole)
public double getPi()
public void setPi(double pi)
public double getRadian()
public void setRadian(double radian)
public double getSecond()
public void setSecond(double second)
public double getScaleToSI()
public void setScaleToSI(double scaleToSI)
public UnitFunction getFunction()
public void setFunction(UnitFunction function)
public String getUCUMExpression()
Copyright © 2016 Sensia Software LLC. All rights reserved.