gnu.java.awt.font.opentype.truetype
Class Fixed

java.lang.Object
  |
  +--gnu.java.awt.font.opentype.truetype.Fixed

final class Fixed
extends java.lang.Object

A utility class for fixed-point arithmetics, where numbers are represented with 26 dot 6 digits. This representation is used by TrueType coordinates.

A good compiler will inline calls of methods in this class.

Author:
Sascha Brawer (brawer@dandelis.ch)

Field Summary
static int ONE
           
 
Constructor Summary
private Fixed()
          The constructor is private so nobody can use it.
 
Method Summary
static int ceil(int a)
           
static int div(int a, int b)
           
static double doubleValue(int f)
           
static float floatValue(int f)
           
static int floor(int a)
           
static int intValue(int f)
           
static int mul(int a, int b)
          Multiplies two fixed-point numbers.
static java.lang.String toString(int f)
          Makes a string representation of a fixed-point number.
static java.lang.String toString(int x, int y)
           
static int valueOf(double d)
           
static int valueOf(float f)
           
static int vectorLength(int x, int y)
          Calculates the length of a fixed-point vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE

public static final int ONE
See Also:
Constant Field Values
Constructor Detail

Fixed

private Fixed()
The constructor is private so nobody can use it.

Method Detail

mul

public static int mul(int a,
                      int b)
Multiplies two fixed-point numbers.


div

public static int div(int a,
                      int b)

ceil

public static int ceil(int a)

floor

public static int floor(int a)

vectorLength

public static int vectorLength(int x,
                               int y)
Calculates the length of a fixed-point vector.


intValue

public static int intValue(int f)

floatValue

public static float floatValue(int f)

doubleValue

public static double doubleValue(int f)

valueOf

public static int valueOf(float f)

valueOf

public static int valueOf(double d)

toString

public static java.lang.String toString(int f)
Makes a string representation of a fixed-point number.


toString

public static java.lang.String toString(int x,
                                        int y)