Package org.jruby.util
Class Sprintf
java.lang.Object
org.jruby.util.Sprintf
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BigIntegerprivate static final BigIntegerprivate static final BigIntegerprivate static final BigIntegerprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final byte[]private static final ThreadLocal<Map<Locale,DecimalFormatSymbols>> private static final ThreadLocal<Map<Locale,NumberFormat>> private static final byte[]private static final byte[]private static final byte[]private static final byte[]private static final byte[]private static final byte[]private static final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcheckOffset(Sprintf.Args args, int offset, int length, String message) private static intextendWidth(Sprintf.Args args, int oldWidth, byte newChar, String errMessage) private static int[]GETASTER(Sprintf.Args args, byte[] format, int offset, int length, boolean width) private static byte[]getBignumBytes(BigInteger val, int base, boolean sign, boolean upper) static DecimalFormatSymbolsgetDecimalFormat(Locale locale) private static byte[]getFixnumBytes(long val, int base, boolean sign, boolean upper) static NumberFormatgetNumberFormat(Locale locale) private static byte[]getUnsignedNegativeBytes(long val) private static byte[]private static booleanisDigit(byte aChar) private static booleanisPrintable(byte aChar) private static voidraiseArgumentError(Sprintf.Args args, String message) private static intround(byte[] bytes, int nDigits, int roundPos, boolean roundDown) private static booleanrubySprintf(ByteList to, CharSequence charFormat, Sprintf.Args args) private static booleanrubySprintfToBuffer(ByteList buf, CharSequence charFormat, Sprintf.Args args) private static booleanrubySprintfToBuffer(ByteList buf, CharSequence charFormat, Sprintf.Args args, boolean usePrefixForZero) private static intskipSignBits(byte[] bytes, int base) static booleansprintf(Ruby runtime, ByteList to, CharSequence format, int arg) static booleansprintf(Ruby runtime, ByteList to, CharSequence format, long arg) static booleansprintf(ByteList to, CharSequence format, IRubyObject args) static booleansprintf(ByteList to, Locale locale, CharSequence format, IRubyObject args) static booleansprintf(ByteList to, RubyString format, IRubyObject args) static booleansprintf1_9(ByteList to, Locale locale, CharSequence format, IRubyObject args) private static byte[]private static byte[]stringToBytes(CharSequence s, boolean upper) private static voidwarning(IRubyWarnings.ID id, Sprintf.Args args, String message) private static void
-
Field Details
-
FLAG_NONE
private static final int FLAG_NONE- See Also:
-
FLAG_SPACE
private static final int FLAG_SPACE- See Also:
-
FLAG_ZERO
private static final int FLAG_ZERO- See Also:
-
FLAG_PLUS
private static final int FLAG_PLUS- See Also:
-
FLAG_MINUS
private static final int FLAG_MINUS- See Also:
-
FLAG_SHARP
private static final int FLAG_SHARP- See Also:
-
FLAG_WIDTH
private static final int FLAG_WIDTH- See Also:
-
FLAG_PRECISION
private static final int FLAG_PRECISION- See Also:
-
PREFIX_OCTAL
private static final byte[] PREFIX_OCTAL -
PREFIX_HEX_LC
private static final byte[] PREFIX_HEX_LC -
PREFIX_HEX_UC
private static final byte[] PREFIX_HEX_UC -
PREFIX_BINARY_LC
private static final byte[] PREFIX_BINARY_LC -
PREFIX_BINARY_UC
private static final byte[] PREFIX_BINARY_UC -
PREFIX_NEGATIVE
private static final byte[] PREFIX_NEGATIVE -
NAN_VALUE
private static final byte[] NAN_VALUE -
INFINITY_VALUE
private static final byte[] INFINITY_VALUE -
BIG_32
-
BIG_64
-
BIG_MINUS_32
-
BIG_MINUS_64
-
ERR_MALFORMED_FORMAT
- See Also:
-
ERR_MALFORMED_NUM
- See Also:
-
ERR_MALFORMED_DOT_NUM
- See Also:
-
ERR_MALFORMED_STAR_NUM
- See Also:
-
ERR_ILLEGAL_FORMAT_CHAR
- See Also:
-
ERR_INCOMPLETE_FORMAT_SPEC
- See Also:
-
ERR_MALFORMED_NAME
- See Also:
-
LOCALE_NUMBER_FORMATS
-
LOCALE_DECIMAL_FORMATS
-
-
Constructor Details
-
Sprintf
private Sprintf()
-
-
Method Details
-
sprintf
-
sprintf1_9
-
sprintf
-
sprintf
-
sprintf
-
sprintf
-
rubySprintf
-
rubySprintfToBuffer
private static boolean rubySprintfToBuffer(ByteList buf, CharSequence charFormat, Sprintf.Args args) -
rubySprintfToBuffer
private static boolean rubySprintfToBuffer(ByteList buf, CharSequence charFormat, Sprintf.Args args, boolean usePrefixForZero) -
getNumberFormat
-
getDecimalFormat
-
writeExp
-
raiseArgumentError
-
warning
-
checkOffset
-
GETASTER
private static int[] GETASTER(Sprintf.Args args, byte[] format, int offset, int length, boolean width) -
extendWidth
-
isDigit
private static boolean isDigit(byte aChar) -
isPrintable
private static boolean isPrintable(byte aChar) -
skipSignBits
private static int skipSignBits(byte[] bytes, int base) -
round
private static int round(byte[] bytes, int nDigits, int roundPos, boolean roundDown) -
getFixnumBytes
private static byte[] getFixnumBytes(long val, int base, boolean sign, boolean upper) -
getBignumBytes
-
getUnsignedNegativeBytes
private static byte[] getUnsignedNegativeBytes(long val) -
getUnsignedNegativeBytes
-
stringToBytes
-
stringToBytes
-