Java Utililty Methods Zero Format

List of utility methods to do Zero Format

Description

The list of methods to do Zero Format are organized into topic(s).

Method

int[]zeros(int n)
zeros
return arr(n, 0);
float[]zeros(int size)
zeros
float[] arr = new float[size];
for (int i = 0; i < size; i++) {
    arr[i] = 0.0f;
return arr;
int[]zerosInt(int len)
zeros Int
return filledArray(0, len);
StringzeroString(int length)
zero String
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; i++) {
    sb.append('0');
return sb.toString();
StringzeroString(int value)
If the given value is less than 10 than pad the String return with a leading "0".
return padZero(value, 2);
StringzeroSupply(String value, int len)
zero Supply
if (value == null) {
    return value;
String supply = "";
for (int i = value.length(); i < len; i++) {
    supply = supply + "0";
return supply + value;
...
int[]zeroThrough(int max)
zero Through
return ints(0, max, 1);
floatzeroToOne(float value, float min, float max)
zero To One
return clamp(0.0f, (value - min) / (max - min), 1.0f);
doublezeroToOne(long _min, long _max, long _value)
zero To One
if (_max == _min) {
    if (_value == _min) {
        return 0;
    if (_value > _max) {
        return Double.MAX_VALUE;
    return -Double.MAX_VALUE;
...
StringzeroToSpace(String s)
zero To Space
boolean allZero = true;
if (s == null) {
    return "";
s = s.trim();
if (s.equals("")) {
    return "";
for (int i = 0; i < s.length(); i++) {
    if (s.charAt(i) == '0') {
        continue;
    } else {
        allZero = false;
        break;
if (allZero == true) {
    return "";
} else {
    return s;