JML

net.sf.jml.util
Class NumberUtils

java.lang.Object
  extended by net.sf.jml.util.NumberUtils

public class NumberUtils
extends Object

Some utils for number

Author:
Roger Chen

Constructor Summary
NumberUtils()
           
 
Method Summary
static int getIntRandom()
           
static int getIntRandom(int i)
           
static boolean isDigits(String s)
           
static boolean isNumber(String s)
           
static byte stringToByte(String s)
           
static byte stringToByte(String s, byte defaultValue)
           
static float stringToFloat(String s)
           
static float stringToFloat(String s, float defaultValue)
           
static int stringToInt(String s)
           
static int stringToInt(String s, int defaultValue)
           
static long stringToLong(String s)
           
static long stringToLong(String s, long defaultValue)
           
static short stringToShort(String s)
           
static short stringToShort(String s, short defaultValue)
           
static String toHexValue(byte b)
           
static String toHexValue(ByteBuffer buffer)
           
static String toHexValue(int i)
           
static String toHexValue(long l)
           
static String toHexValue(short s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberUtils

public NumberUtils()
Method Detail

isDigits

public static boolean isDigits(String s)

isNumber

public static boolean isNumber(String s)

stringToByte

public static byte stringToByte(String s,
                                byte defaultValue)

stringToByte

public static byte stringToByte(String s)

stringToShort

public static short stringToShort(String s,
                                  short defaultValue)

stringToShort

public static short stringToShort(String s)

stringToInt

public static int stringToInt(String s,
                              int defaultValue)

stringToInt

public static int stringToInt(String s)

stringToLong

public static long stringToLong(String s,
                                long defaultValue)

stringToLong

public static long stringToLong(String s)

stringToFloat

public static float stringToFloat(String s,
                                  float defaultValue)

stringToFloat

public static float stringToFloat(String s)

toHexValue

public static String toHexValue(ByteBuffer buffer)

toHexValue

public static String toHexValue(long l)

toHexValue

public static String toHexValue(int i)

toHexValue

public static String toHexValue(short s)

toHexValue

public static String toHexValue(byte b)

getIntRandom

public static int getIntRandom(int i)

getIntRandom

public static int getIntRandom()

JML