Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mvsteenb.javauitransformer.xmltransformer.util
Class MathUtil  view MathUtil download MathUtil.java

java.lang.Object
  extended bycom.mvsteenb.javauitransformer.xmltransformer.util.MathUtil

public class MathUtil
extends java.lang.Object

com.mvsteenb.javauitransformer.xmltransformer.util

Description

Free Software

Copyright (C) 2003 Mario Van Steenberghe

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

Please contact me at mario.vansteenberghe@pandora.be for more information.

Revision History

Aug 24, 2003 : mvsteenb : Initial Revision


Constructor Summary
MathUtil()
           
 
Method Summary
static int byteToInt(byte b)
          Converts byte to int
static int charToNibble(char c)
          Convert a single char to corresponding nibble.
static double getClosestRound(double value)
          Returns closest round value
static byte[] hexStringToByteArray(java.lang.String s)
          Converts given hexadecimal string (even number of chars) to byte array
static byte[] integerToByteArray(int val)
          Converts integer to byte array
static char[] integerToCharArray(int val)
          Converts integer to byte array
static java.lang.String integerToHexString(int val, boolean showZeros)
          Converts integer to hex string
static void main(java.lang.String[] args)
          Runs Test
static char nibbleToHexChar(int c)
          Convert nibble to corresponding single char.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathUtil

public MathUtil()
Method Detail

getClosestRound

public static double getClosestRound(double value)
Returns closest round value


hexStringToByteArray

public static byte[] hexStringToByteArray(java.lang.String s)
Converts given hexadecimal string (even number of chars) to byte array


integerToHexString

public static java.lang.String integerToHexString(int val,
                                                  boolean showZeros)
Converts integer to hex string


integerToByteArray

public static byte[] integerToByteArray(int val)
Converts integer to byte array


integerToCharArray

public static char[] integerToCharArray(int val)
Converts integer to byte array


charToNibble

public static int charToNibble(char c)
Convert a single char to corresponding nibble.


nibbleToHexChar

public static char nibbleToHexChar(int c)
Convert nibble to corresponding single char.


byteToInt

public static int byteToInt(byte b)
Converts byte to int


main

public static void main(java.lang.String[] args)
Runs Test