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 enumRendering base.static enumNotation 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()booleanvoidsetBase(NumberFormatter.Base base) voidsetNotationType(NumberFormatter.NotationType notationType) voidsetSignedNumber(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)
-