/** * Create a new number factory.<p> * * @param digits the number of digits to use */ public CmsNumberFactory(int digits) { m_numberFormat = new PrintfFormat("%0." + digits + "d"); m_number = 0; }
/** * Applies white space padding to the left of the given String.<p> * * @param input the input to pad left * @param size the size of the padding * * @return the input padded to the left */ public static String padLeft(String input, int size) { return (new PrintfFormat("%" + size + "s")).sprintf(input); }
/** * Applies white space padding to the right of the given String.<p> * * @param input the input to pad right * @param size the size of the padding * * @return the input padded to the right */ public static String padRight(String input, int size) { return (new PrintfFormat("%-" + size + "s")).sprintf(input); }
/** * Applies white space padding to the left of the given String.<p> * * @param input the input to pad left * @param size the size of the padding * * @return the input padded to the left */ public static String padLeft(String input, int size) { return (new PrintfFormat("%" + size + "s")).sprintf(input); }
/** * Applies white space padding to the right of the given String.<p> * * @param input the input to pad right * @param size the size of the padding * * @return the input padded to the right */ public static String padRight(String input, int size) { return (new PrintfFormat("%-" + size + "s")).sprintf(input); }
/** * Adds a numeric suffix to the end of a string, unless the number passed as a parameter is 0.<p> * * @param name the base name * @param number the number from which to form the suffix * * @return the concatenation of the base name and possibly the numeric suffix */ protected String getNumberedName(String name, int number) { if (number == 0) { return name; } PrintfFormat fmt = new PrintfFormat("%0.6d"); return name + "_" + fmt.sprintf(number); }
totalSize += size; PrintfFormat name1 = new PrintfFormat("%-80s"); PrintfFormat name2 = new PrintfFormat("%-50s"); PrintfFormat form = new PrintfFormat("%9s"); LOG.info(Messages.get().getBundle().key( Messages.LOG_MM_NOWARN_STATUS_5,
totalSize += size; PrintfFormat name1 = new PrintfFormat("%-80s"); PrintfFormat name2 = new PrintfFormat("%-50s"); PrintfFormat form = new PrintfFormat("%9s"); LOG.info( Messages.get().getBundle().key(
String[] shortKeys = key.split("\\."); String shortKey = shortKeys[shortKeys.length - 2] + '.' + shortKeys[shortKeys.length - 1]; PrintfFormat form = new PrintfFormat("%9s"); Object obj = m_monitoredObjects.get(key); totalSize += size; content += new PrintfFormat("%-42.42s").sprintf(shortKey) + " " + "Entries: "
String[] shortKeys = key.split("\\."); String shortKey = shortKeys[shortKeys.length - 2] + '.' + shortKeys[shortKeys.length - 1]; PrintfFormat form = new PrintfFormat("%9s"); Object obj = m_monitoredObjects.get(key); totalSize += size; content += new PrintfFormat("%-42.42s").sprintf(shortKey) + " " + "Entries: "
PrintfFormat numberFormat = new PrintfFormat("%0." + getParamPlaces() + "d");
PrintfFormat numberFormat = new PrintfFormat("%0." + getParamPlaces() + "d");