/** * Format nothing. Just use the control string. * @return the formatted String. */ public String sprintf() { Enumeration<ConversionSpecification> e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } } return sb.toString(); }
/** * Format nothing. Just use the control string. * @return the formatted String. */ public String sprintf() { Enumeration e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification)e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } } return sb.toString(); }
/** * Format a String. * @param x The String to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is neither s nor S. */ public String sprintf(String x) throws CmsIllegalArgumentException { Enumeration<ConversionSpecification> e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%");
c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%");
c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%");
c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%");
/** * Format an long. * @param x The long to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is f, e, E, g, G, s, * or S. */ public String sprintf(long x) throws CmsIllegalArgumentException { Enumeration<ConversionSpecification> e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
/** * Format a double. * @param x The double to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is c, C, s, S, * d, d, x, X, or o. */ public String sprintf(double x) throws CmsIllegalArgumentException { Enumeration<ConversionSpecification> e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
/** * Format a double. * @param x The double to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is c, C, s, S, * d, d, x, X, or o. */ public String sprintf(double x) throws CmsIllegalArgumentException { Enumeration e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification)e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
/** * Format a String. * @param x The String to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is neither s nor S. */ public String sprintf(String x) throws CmsIllegalArgumentException { Enumeration e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification)e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
/** * Format an long. * @param x The long to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is f, e, E, g, G, s, * or S. */ public String sprintf(long x) throws CmsIllegalArgumentException { Enumeration e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification)e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
/** * Format an int. * @param x The int to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is f, e, E, g, G, s, * or S. */ public String sprintf(int x) throws CmsIllegalArgumentException { Enumeration e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification)e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }
/** * Format an int. * @param x The int to format. * @return The formatted String. * @exception CmsIllegalArgumentException if the * conversion character is f, e, E, g, G, s, * or S. */ public String sprintf(int x) throws CmsIllegalArgumentException { Enumeration<ConversionSpecification> e = m_vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb = new StringBuffer(); while (e.hasMoreElements()) { cs = e.nextElement(); c = cs.getConversionCharacter(); if (c == '\0') { sb.append(cs.getLiteral()); } else if (c == '%') { sb.append("%"); } else { sb.append(cs.internalsprintf(x)); } } return sb.toString(); }