Home » openjdk-7 » net.bonzoun » cocodonkey » [javadoc | source]
net.bonzoun.cocodonkey
class: PrintfFormat.ConversionSpecification [javadoc | source]
java.lang.Object
   net.bonzoun.cocodonkey.PrintfFormat$ConversionSpecification
*

* ConversionSpecification allows the formatting of * a single primitive or object embedded within a * string. The formatting is controlled by a * format string. Only one Java primitive or * object can be formatted at a time. *

* A format string is a Java string that contains * a control string. The control string starts at * the first percent sign (%) in the string, * provided that this percent sign *

    *
  1. is not escaped protected by a matching % or * is not an escape % character, *
  2. is not at the end of the format string, and *
  3. precedes a sequence of characters that parses * as a valid control string. *
*

* A control string takes the form: *

 % ['-+ #0]* [0..9]* { . [0..9]* }+
   *                { [hlL] }+ [idfgGoxXeEcs]
   *
*

* The behavior is like printf. One (hopefully the * only) exception is that the minimum number of * exponent digits is 3 instead of 2 for e and E * formats when the optional L is used before the * e, E, g, or G conversion character. The * optional L does not imply conversion to a long * long double.
Constructor:
 ConversionSpecification() 
 ConversionSpecification(String fmtArg) throws IllegalArgumentException 
    * Constructor for a conversion specification. * The argument must begin with a % and end * with the conversion character for the * conversion specification. * @param fmtArg String specifying the * conversion specification. * @exception IllegalArgumentException if the * input string is null, zero length, or * otherwise malformed.
Method from net.bonzoun.cocodonkey.PrintfFormat$ConversionSpecification Summary:
getArgumentPosition,   getArgumentPositionForFieldWidth,   getArgumentPositionForPrecision,   getConversionCharacter,   getLiteral,   internalsprintf,   internalsprintf,   internalsprintf,   internalsprintf,   internalsprintf,   isPositionalFieldWidth,   isPositionalPrecision,   isPositionalSpecification,   isVariableFieldWidth,   isVariablePrecision,   setFieldWidthWithArg,   setLiteral,   setPrecisionWithArg
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from net.bonzoun.cocodonkey.PrintfFormat$ConversionSpecification Detail:
 int getArgumentPosition() 
 int getArgumentPositionForFieldWidth() 
 int getArgumentPositionForPrecision() 
 char getConversionCharacter() 
    * Get the conversion character that tells what * type of control character this instance has. * * @return the conversion character.
 String getLiteral() 
    * Get the String for this instance. Translate * any escape sequences. * * @return s the stored String.
 String internalsprintf(int s) throws IllegalArgumentException 
    * Format an int argument using this conversion * specification. * @param s the int to format. * @return the formatted String. * @exception IllegalArgumentException if the * conversion character is f, e, E, g, or G.
 String internalsprintf(long s) throws IllegalArgumentException 
    * Format a long argument using this conversion * specification. * @param s the long to format. * @return the formatted String. * @exception IllegalArgumentException if the * conversion character is f, e, E, g, or G.
 String internalsprintf(double s) throws IllegalArgumentException 
    * Format a double argument using this conversion * specification. * @param s the double to format. * @return the formatted String. * @exception IllegalArgumentException if the * conversion character is c, C, s, S, i, d, * x, X, or o.
 String internalsprintf(String s) throws IllegalArgumentException 
    * Format a String argument using this conversion * specification. * @param s the String to format. * @return the formatted String. * @exception IllegalArgumentException if the * conversion character is neither s nor S.
 String internalsprintf(Object s) 
    * Format an Object argument using this conversion * specification. * @param s the Object to format. * @return the formatted String. * @exception IllegalArgumentException if the * conversion character is neither s nor S.
 boolean isPositionalFieldWidth() 
 boolean isPositionalPrecision() 
 boolean isPositionalSpecification() 
 boolean isVariableFieldWidth() 
    * Check whether the specifier has a variable * field width that is going to be set by an * argument. * @return true if the conversion * uses an * field width; otherwise * false.
 boolean isVariablePrecision() 
    * Check whether the specifier has a variable * precision that is going to be set by an * argument. * @return true if the conversion * uses an * precision; otherwise * false.
  void setFieldWidthWithArg(int fw) 
    * Set the field width with an argument. A * negative field width is taken as a - flag * followed by a positive field width. * @param fw the field width.
  void setLiteral(String s) 
    * Set the String for this instance. * @param s the String to store.
  void setPrecisionWithArg(int pr) 
    * Set the precision with an argument. A * negative precision will be changed to zero. * @param pr the precision.