org.opensubsystems.core.util
Class NumberUtils

java.lang.Object
  extended by org.opensubsystems.core.util.NumberUtils

public final class NumberUtils
extends java.lang.Object

Collection of useful utilities to work with numbers.

Version:
$Id: NumberUtils.java,v 1.9 2007/01/07 06:14:01 bastafidli Exp $
Author:
Peter Satury
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
static java.text.NumberFormat NFCURRENCYFORMAT
          static Number format for Currency
static java.text.NumberFormat NFCURRENCYFORMATEDIT
          static Number format for Currency for editing
static java.text.NumberFormat NFFORMAT
          static Number format for no Exponent
static java.text.NumberFormat NFFORMATEDIT
          static Number format for no Exponent for editing
protected static char[] ZEROCHARS
          Static array used to append leading 0 chars to file name constructed from number.
 
Method Summary
static long exponentiate(int iBbase, int iExponent)
          Method to make Exponention
static java.lang.String getDigitNumberString(int iInputNumber, int iDigitLength)
          Method to make specified length digit number string representation from particular input number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZEROCHARS

protected static final char[] ZEROCHARS
Static array used to append leading 0 chars to file name constructed from number.


NFFORMAT

public static final java.text.NumberFormat NFFORMAT
static Number format for no Exponent


NFFORMATEDIT

public static final java.text.NumberFormat NFFORMATEDIT
static Number format for no Exponent for editing


NFCURRENCYFORMAT

public static final java.text.NumberFormat NFCURRENCYFORMAT
static Number format for Currency


NFCURRENCYFORMATEDIT

public static final java.text.NumberFormat NFCURRENCYFORMATEDIT
static Number format for Currency for editing

Method Detail

exponentiate

public static long exponentiate(int iBbase,
                                int iExponent)
                         throws java.lang.IllegalArgumentException
Method to make Exponention

Parameters:
iBbase - - base of Exponention [1..]
iExponent - - exponent of Exponention [0..14]
Returns:
long - result of Exponention
Throws:
java.lang.IllegalArgumentException - - in case of arguments out of valid range

getDigitNumberString

public static java.lang.String getDigitNumberString(int iInputNumber,
                                                    int iDigitLength)
Method to make specified length digit number string representation from particular input number. For example, if there will be send input number 32 and digit lenhth = 8, output will be string '00000032'

Parameters:
iInputNumber - - input number that will be converted into 8 digit number string representation
iDigitLength - - length of the output digit number string
Returns:
String - digit number string representation


Copyright © 2003 - 2006 OpenSubsystems s.r.o.