Codota Logo
PrintfFormat.sprintf
Code IndexAdd Codota to your IDE (free)

How to use
sprintf
method
in
org.opencms.util.PrintfFormat

Best Java code snippets using org.opencms.util.PrintfFormat.sprintf (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.opencms/opencms-core

/**
 * Create the number based on the number of digits set.<p>
 *
 * @see org.apache.commons.collections.Factory#create()
 */
public Object create() {
  // formats the number with the amount of digits selected
  return m_numberFormat.sprintf(m_number);
}
origin: org.opencms/opencms-core

/**
 * @see java.util.Iterator#next()
 */
public String next() {
  String result = m_baseName;
  if (m_counter > 0) {
    String numberSuffix = "-" + I_CmsFileNameGenerator.NUMBER_FORMAT.sprintf(m_counter);
    if (m_prefix == null) {
      result = m_baseName + numberSuffix;
    } else {
      result = m_prefix + numberSuffix + m_suffix;
    }
  }
  m_counter += 1;
  return result;
}
origin: org.opencms/opencms-core

/**
 * 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);
}
origin: org.opencms/opencms-core

@Override
public Object create() {
  if (explorerMode) {
    if (m_number == 1) {
      return "";
    } else {
      return "_" + m_numberFormat.sprintf(m_number - 1);
    }
  } else {
    return super.create();
  }
}
origin: org.opencms/opencms-solr

/**
 * 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);
}
origin: org.opencms/opencms-core

/**
 * 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);
}
origin: org.opencms/opencms-solr

/**
 * 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);
}
origin: org.opencms/opencms-core

/**
 * 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);
}
origin: org.opencms/opencms-solr

number = NUMBER_FORMAT.sprintf(++j);
resolver.addMacro(MACRO_NUMBER, number);
origin: org.opencms/opencms-solr

Messages.LOG_MM_NOWARN_STATUS_5,
new Object[] {
  name1.sprintf(key),
  name2.sprintf(obj.getClass().getName()),
  form.sprintf(getItems(obj)),
  form.sprintf(getLimit(obj)),
  form.sprintf(Long.toString(size))}));
origin: org.opencms/opencms-core

Messages.LOG_MM_NOWARN_STATUS_5,
new Object[] {
  name1.sprintf(key),
  name2.sprintf(obj.getClass().getName()),
  form.sprintf(getItems(obj)),
  form.sprintf(getLimit(obj)),
  form.sprintf(Long.toString(size))}));
origin: org.opencms/opencms-solr

totalSize += size;
content += new PrintfFormat("%-42.42s").sprintf(shortKey)
  + "  "
  + "Entries: "
  + form.sprintf(getItems(obj))
  + "   "
  + "Limit: "
  + form.sprintf(getLimit(obj))
  + "   "
  + "Size: "
origin: org.opencms/opencms-core

totalSize += size;
content += new PrintfFormat("%-42.42s").sprintf(shortKey)
  + "  "
  + "Entries: "
  + form.sprintf(getItems(obj))
  + "   "
  + "Limit: "
  + form.sprintf(getLimit(obj))
  + "   "
  + "Size: "
  + form.sprintf(Long.toString(size))
  + "\n";
origin: org.opencms/opencms-solr

String imageNumber = numberFormat.sprintf(count);
newName += imageNumber + suffix;
origin: org.opencms/org.opencms.workplace

String imageNumber = numberFormat.sprintf(count);
newName += imageNumber + suffix;
org.opencms.utilPrintfFormatsprintf

Javadoc

Format nothing. Just use the control string.

Popular methods of PrintfFormat

  • <init>
    Constructs an array of control specifications possibly preceded, separated, or followed by ordinary
  • nonControl
    Return a substring starting atstart and ending at either the end of the String s , the next unpaired

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now