com.moesol.util
Class HexFormatter

java.lang.Object
  extended by com.moesol.util.HexFormatter

public class HexFormatter
extends Object

Format hex numbers with leading padding if needed.


Constructor Summary
HexFormatter()
           
 
Method Summary
static void appendPaddedHex(StringBuffer r, long value, int width, char pad_char)
           
static String format(long value, int width)
           
static String format(long value, int width, char pad_char)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexFormatter

public HexFormatter()
Method Detail

format

public static String format(long value,
                            int width)
Parameters:
value - value to format as hex
width - width of all output
Returns:
hex formatted String

format

public static String format(long value,
                            int width,
                            char pad_char)
Parameters:
value - value to format as hex
width - width of all output
pad_char - character to insert if padding is needed
Returns:
hex formatted String

appendPaddedHex

public static void appendPaddedHex(StringBuffer r,
                                   long value,
                                   int width,
                                   char pad_char)


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.