Here you can find the source of getTeamIDFormat()
public static NumberFormat getTeamIDFormat()
//package com.java2s; //License from project: Open Source License import java.text.NumberFormat; public class Main { public static NumberFormat getTeamIDFormat() { NumberFormat format = NumberFormat.getIntegerInstance(); format.setMinimumIntegerDigits(1); format.setMaximumIntegerDigits(4); format.setGroupingUsed(false);/*from ww w .ja v a 2 s .c o m*/ format.setParseIntegerOnly(true); return format; } }