adds zeros add the begin of a int example: addZeros(2,3) return "002"

@param i number to add nulls
@param size
@return min len of return value;
487439
public static String addZeros(int i, int size) {
	String rtn = Caster.toString(i);
	if (rtn.length() < size) return repeatString("0", size - rtn.length()) + rtn;
	return rtn;
    }
490104
public void setLength(int size)
  {
    expand(size);

    for (int i = _size; i < size; i++)
      _data[i] = 0;

    _size = size;
  }
778108
private Double zeroIsNull(Double value)
   {
      if (value != null && value.doubleValue() == 0)
      {
         value = null;
      }
      return value;
   }
538698
public static int size(String size, int defaultValue) {
        int parseInt = NumUtils.intVal(size, defaultValue);
        return parseInt <= 0 ? defaultValue
                : (parseInt > DEFAULT_MAX_PAGE_SIZE ? DEFAULT_MAX_PAGE_SIZE : parseInt);
    }
909039
public static GrowQueue_I8 zeros( int length ) {
		GrowQueue_I8 out = new GrowQueue_I8(length);
		out.size = length;
		return out;
	}
50620
public void add(int i)
  {
    if (_data.length <= _size)
      expand(_size + 1);

    _data[_size++] = i;
  }
312247
public void setValues(int[] values, int size)
  {
    if (size < 0 || size > values.length) {
      throw new IAE("Size[%d] should be between 0 and %d", size, values.length);
    }
    ensureSize(size);
    System.arraycopy(values, 0, expansion, 0, size);
    this.size = size;
  }
414609
public static int addOffset(int index, int offset, int size) {
		index += offset;
		if( index < 0 ) {
			return size + index;
		} else {
			return index%size;
		}
	}
1249943
private static int zero(byte[] block, int offset, int len) {
    Util.zero(block, offset, len);
    return len;
  }
1328705
private void expandIfNecessary(int size) {
    if (bytes.length >= size) {
      // no need to expand
      return;
    }
    // either double, or expand to fit size
    int newlength = Math.max(2 * bytes.length, size);
    bytes = Arrays.copyOf(bytes, newlength);
  }
314042
void zeroPad2(StringBuilder b, int value, int width) {
    switch (width) {
      case 2:
        if (value < 10) {
          b.append('0');
        }
        // fall through

      case 1:
        b.append(value);
        break;
    }
  }
1058079
public static Integer[] generateBySet(int begin, int end, int size) {
		if (begin > end) {
			int temp = begin;
			begin = end;
			end = temp;
		}
		// 加入逻辑判断，确保begin<end并且size不能大于该表示范围
		if ((end - begin) < size) {
			throw new UtilException("Size is larger than range between begin and end!");
		}

		Random ran = new Random();
		Set<Integer> set = new HashSet<Integer>();
		while (set.size() < size) {
			set.add(begin + ran.nextInt(end - begin));
		}

		Integer[] ranArr = set.toArray(new Integer[size]);
		return ranArr;
	}
266240
public static String supplyZero(final String str, final int size) {
        
        if(str == null) {
            return "";
        }
        final int length = str.length();
        if(length > size) {
            return str;
        }
        
        StringBuilder sb = new StringBuilder();
        final int appendSize = size - length;
        for(int i=0; i < appendSize; i++) {
            sb.append("0");
        }
        sb.append(str);
        
        return sb.toString();
        
    }
273482
public final synchronized void add(final double v) {
    sum0 += 1;
    sum1 += v;
    sum2 += v * v;
    min = Math.min(min, v);
    max = Math.max(max, v);
    if (Math.abs(v) < com.simiacryptus.util.data.ScalarStatistics.zeroTol) {
      zeros++;
    }
    else {
      if (v < 0) {
        negatives++;
      }
      else {
        positives++;
      }
      sumLog += Math.log10(Math.abs(v));
    }
  }
61087
public IntegerConstant addInteger(int value)
  {
    IntegerConstant entry = getIntegerByValue(value);

    if (entry != null)
      return entry;

    entry = new IntegerConstant(this, _entries.size(), value);

    addConstant(entry);

    return entry;
  }
247035
static private String zeros(int n)
  {
    if (n < 1)
      return "";

    char[] buf = new char[n];

    for (int i = 0; i < n; i++)
    {
      buf[i] = '0';
    }

    return new String(buf);
  }
393002
public final void setToSize(int size) {
    
    int newMap[] = new int[size];

    System.arraycopy(m_map, 0, newMap, 0, m_map[m_lengthPos]);

    m_mapSize = size;
    m_map = newMap;
    
  }