java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.primitives.Integers |
Utility methods for int
s
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Integers() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static String |
formatHexIntegerCollection(Collection<Integer> list)
Format a collection of ints.
| ||||||||||
static String |
formatIntegerCollection(Collection<Integer> collection, Integer radix, String pfx, String sfx)
Format a collection of ints.
| ||||||||||
static String | formatIntegerCollection(Collection<Integer> collection, Integer radix, String pfx, String sfx, String separator) | ||||||||||
static Integer | max(Collection<Integer> c) | ||||||||||
static Integer | min(Collection<Integer> c) | ||||||||||
static Iterable<Integer> |
range(int cnt)
Generate an incremental range of integers from 0 to the provided count.
| ||||||||||
static Iterable<Integer> |
range(int start, int end, int step)
Generate an iterable range of integers.
| ||||||||||
static Iterable<Integer> |
range(int start, int end)
Generate an incremental range of integers.
| ||||||||||
static int |
safeInt(Integer v)
Safe unbox an Integer to zero when null.
| ||||||||||
static Integer |
safeInt(Integer v, int defaultValue)
Safe unbox an Integer to defaultValue when null.
| ||||||||||
static String | toUnsignedString(int value) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Format a collection of ints.
Format a collection of ints.
radix | optional, default=10 |
---|---|
pfx | optional, default=none |
sfx | optional, default=none |
Generate an incremental range of integers from 0 to the provided count.
Generate an iterable range of integers.
end | exclusive |
---|---|
step | increment (can be negative, cannot be zero) |
Generate an incremental range of integers.
end | exclusive |
---|
Safe unbox an Integer to zero when null.
v | an Integer object |
---|
Safe unbox an Integer to defaultValue when null.
v | an Integer object |
---|---|
defaultValue | default value if null |