Package com.pnfsoftware.jeb.util.format
Class NumberFormatter
java.lang.Object
com.pnfsoftware.jeb.util.format.NumberFormatter
A number formatter, supporting formatting of immediates of variable sizes using different bases
and other properties (e.g., signedness).
Notes:
- maximum size: 64-bit
- signedness: applicable to octal/decimal/hexadecimal bases only; N/A for binary or ascii formatting
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Rendering base.static enum
Notation type for hexadecimal bases. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat
(int bitsize, long rawValue) Format a number using the formatter's current settings.format
(int bitsize, long rawValue, NumberFormatter.Base base, boolean treatAsSignedNumber) getBase()
boolean
void
setBase
(NumberFormatter.Base base) void
setNotationType
(NumberFormatter.NotationType notationType) void
setSignedNumber
(boolean signedNumber)
-
Constructor Details
-
NumberFormatter
public NumberFormatter() -
NumberFormatter
- Parameters:
defaultNumberFormatter
-
-
-
Method Details
-
getBase
-
setBase
-
rotateBase
-
setSignedNumber
public void setSignedNumber(boolean signedNumber) -
isSignedNumber
public boolean isSignedNumber() -
setNotationType
-
getNotationType
-
format
Format a number using the formatter's current settings. -
format
public String format(int bitsize, long rawValue, NumberFormatter.Base base, boolean treatAsSignedNumber)
-