|
Unified Typesetting API M1-20040817 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.inghuimische.uta.util.UnitConverter
This class is able to convert directly between the following units: scaled point (sp), point (pt), pica (pc), inch (in), big point (bp), didot point (dd), cicero (cc), centimeter (cm), millimeter (mm), meter (m).
The terms used for the units are equal to those used by Knuth in The TeXbook, chapter 12.
Field Summary | |
static int |
BIG_POINT
72 big points make one inch. |
static int |
CENTIMETER
100 centimeter are one meter. |
static int |
CICERO
12 didot points are one cicero. |
static int |
DIDOT_POINT
1157 didot points make 1238 points. |
static int |
INCH
2.54cm are one inch. |
static int |
METER
meter |
static int |
MILLIMETER
1000 millimeter are one meter. |
static int |
PICA
12 points are one pica. |
static int |
POINT
72.27 points are one INCH . |
static int |
SCALED_POINT
A 65536 scaled points make one POINT . |
Constructor Summary | |
UnitConverter()
Creates a new unit converter. |
Method Summary | |
double |
convert(int sourceUnit,
int destUnit,
double value)
Convert the given value from sourceUnit
to destUnit . |
String |
getUnitAbbreviation(int unit)
Returns the abbreviation for the given unit. |
String |
printMatrix()
Utility method generating and returning the matrix as string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SCALED_POINT
POINT
. This unit is used
by UTA and TeX.
public static final int POINT
INCH
.
public static final int PICA
public static final int INCH
public static final int BIG_POINT
public static final int DIDOT_POINT
public static final int CICERO
public static final int CENTIMETER
public static final int MILLIMETER
public static final int METER
Constructor Detail |
public UnitConverter()
Method Detail |
public double convert(int sourceUnit, int destUnit, double value)
value
from sourceUnit
to destUnit
.
sourceUnit
- The source unit.destUnit
- The destination unit.value
- The value to convert.
IllegalArgumentException
- if unit
is not a valid
unit.public String getUnitAbbreviation(int unit)
unit
- One of the constants defined in this class.
IllegalArgumentException
- if unit
is not a valid
unit.public String printMatrix()
|
Unified Typesetting API M1-20040817 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() An inghuimische.de project. | Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details. |