|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sigh.utils.SIGH_license
com.sigh.utils.strings.OutputSeparatorsForDigitStrings
com.sigh.utils.strings.ThreeDigitSeparator
com.sigh.utils.strings.c_functions.Csprintf
public class Csprintf
Csprintf provides c format string capability as described in the Csprintf User's Manual. It emulates the c programming lanugage's sprintf description.
Constructor Summary | |
---|---|
Csprintf()
This is the constructor for Csprintf To create a new instantiation of Csprintf Csprintf csf = new Csprintf(); |
Method Summary | |
---|---|
java.lang.String |
changeSign(java.lang.String theValue2Inspect)
changeSign -- |
java.lang.String |
doSprintf(java.lang.String formatString,
java.lang.Object[] formatValues)
author Software Industry & General Hardware |
java.lang.String |
formatUnsignedLong(long value)
|
static boolean |
isValidFormatString(java.lang.String theFormatString)
Checks a format string to see if it is valid and returns true if it is and false if it is not. |
java.lang.String |
set3DigitSeparatorString(char nxtSeparator)
This method allows the user to set the 3-digit separator string value to whatever they want from a character values passed in. |
java.lang.String |
set3DigitSeparatorString(java.lang.String nxtSeparator)
This routine allows the user to set the 3-digit separator string value to whatever they want. |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object formatValue)
This allows a static call with a single object so you can do the following: System.out.println ( Csprintf.sprintf ( "%04x",
intObject ) );
author Software Industry & General Hardware |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object[] anObject)
This allows a static call with an object array so you can do the following: Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf (
"%04x @ %04d-%02d-%02d", arrayOfIntObjects ) );
author Software Industry & General Hardware |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object[] anObject,
int groupingCount)
This allows a static call with an object array so you can do the following: Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf ( "%04x @ %04d-%02d-%02d", arrayOfIntObjects, 4 ) );
author Software Industry & General Hardware |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object[] anObject,
java.lang.String groupingSeparator)
This allows a static call with an object array so you can do the following: Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf (
"%04x @ %04d-%02d-%02d", arrayOfIntObjects, "." ) );
author Software Industry & General Hardware |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object[] anObject,
java.lang.String groupingSeparator,
int groupingCount)
This allows a static call with an object array so you can do the following: Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf (
"%04x @ %04d-%02d-%02d", arrayOfIntObjects, ".", 4 ) );
author Software Industry & General Hardware |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object formatValue,
int groupingCount)
This allows a static call with a single object so you can do the following: System.out.println ( Csprintf.sprintf ( "%04x",
intObject, ".", 4 ) );
author Software Industry & General Hardware |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object formatValue,
java.lang.String groupingString)
This allows a static call with a single object so you can do the following: System.out.println ( Csprintf.sprintf ( "%04x",
intObject, "." ) );
author Software Industry & General Hardware |
static java.lang.String |
sprintf(java.lang.String formatString,
java.lang.Object formatValue,
java.lang.String groupingString,
int groupingCount)
This allows a static call with a single object so you can do the following: System.out.println ( Csprintf.sprintf ( "%04x",
intObject, ".", 4 ) );
author Software Industry & General Hardware |
java.lang.String |
stripSign(java.lang.String theValue2Strip)
stripSign -- Removes a '-' or a '+' from the front of a String representation of a number. |
static java.lang.String |
version()
author Software Industry & General Hardware |
Methods inherited from class com.sigh.utils.strings.ThreeDigitSeparator |
---|
addCommas, usage |
Methods inherited from class com.sigh.utils.SIGH_license |
---|
license |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Csprintf()
Csprintf csf = new Csprintf();
Method Detail |
---|
public static java.lang.String version()
public java.lang.String doSprintf(java.lang.String formatString, java.lang.Object[] formatValues) throws CsprintfExceptions
formatString
- formatValues
- an Object array with the values to insert in the format string
CSprintfExceptions
- CsprintfExceptions
public java.lang.String set3DigitSeparatorString(java.lang.String nxtSeparator)
nxtSeparator
-
public java.lang.String set3DigitSeparatorString(char nxtSeparator)
nxtSeparator
- A character value
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object formatValue) throws CsprintfExceptions
System.out.println ( Csprintf.sprintf ( "%04x",
intObject ) );
author Software Industry & General Hardware
formatString
- String containing the c format stringformatValue
- An object containing the value to be formated by the c format
string.
CsprintfExceptions
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object formatValue, java.lang.String groupingString) throws CsprintfExceptions
System.out.println ( Csprintf.sprintf ( "%04x",
intObject, "." ) );
author Software Industry & General Hardware
formatString
- String containing the c format stringformatValue
- An object containing the value to be formated by the c format
string.groupingString
- The string to be used to separate the formated value into
groups. In North America this value defaults to a comma. In
Europe it defaults to a period. For example in North America
the commas in the string 1,234,567 would be the
groupingString. For example in IPv6
2001:0db8:0000:0000:0000:0000:1428:57ab the colon is the
groupingString
CsprintfExceptions
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object formatValue, java.lang.String groupingString, int groupingCount) throws CsprintfExceptions
System.out.println ( Csprintf.sprintf ( "%04x",
intObject, ".", 4 ) );
author Software Industry & General Hardware
formatString
- String containing the c format stringformatValue
- An object containing the value to be formated by the c format
string.groupingString
- The string to be used to separate the formated value into
groups. In North America this value defaults to a comma. In
Europe it defaults to a period. For example in North America
the commas in the string 1,234,567 would be the
groupingString. For example in IPv6
2001:0db8:0000:0000:0000:0000:1428:57ab the colon is the
groupingStringgroupingCount
- The count of digits to group together before adding a
groupingString. For example in IPv6
2001:0db8:0000:0000:0000:0000:1428:57ab the groupingCount is 4
CsprintfExceptions
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object formatValue, int groupingCount) throws CsprintfExceptions
System.out.println ( Csprintf.sprintf ( "%04x",
intObject, ".", 4 ) );
author Software Industry & General Hardware
formatString
- String containing the c format stringformatValue
- An object containing the value to be formated by the c format
string.groupingCount
- The count of digits to group together before adding a
groupingString. For example in IPv6
2001:0db8:0000:0000:0000:0000:1428:57ab the groupingCount is 4
CsprintfExceptions
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object[] anObject) throws CsprintfExceptions
Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf (
"%04x @ %04d-%02d-%02d", arrayOfIntObjects ) );
author Software Industry & General Hardware
formatString
- anObject
-
CsprintfExceptions
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object[] anObject, java.lang.String groupingSeparator, int groupingCount) throws CsprintfExceptions
Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf (
"%04x @ %04d-%02d-%02d", arrayOfIntObjects, ".", 4 ) );
author Software Industry & General Hardware
formatString
- anObject
- groupingSeparator
- groupingCount
-
CsprintfExceptions
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object[] anObject, java.lang.String groupingSeparator) throws CsprintfExceptions
Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf (
"%04x @ %04d-%02d-%02d", arrayOfIntObjects, "." ) );
author Software Industry & General Hardware
formatString
- anObject
- groupingSeparator
-
CsprintfExceptions
public static java.lang.String sprintf(java.lang.String formatString, java.lang.Object[] anObject, int groupingCount) throws CsprintfExceptions
Object[] arrayOfIntObjects = new Object [ 4 ];
arrayOfIntObjects [ 0 ] = valueFound; arrayOfIntObjects [ 1 ] =
yearValue; arrayOfIntObjects [ 2 ] = monthValue; arrayOfIntObjects [ 3 ]
= dayValue; System.out.println ( Csprintf.sprintf ( "%04x @ %04d-%02d-%02d", arrayOfIntObjects, 4 ) );
author Software Industry & General Hardware
formatString
- anObject
- groupingCount
-
CsprintfExceptions
public static boolean isValidFormatString(java.lang.String theFormatString)
theFormatString
-
public java.lang.String stripSign(java.lang.String theValue2Strip)
theValue2Strip
-
public java.lang.String changeSign(java.lang.String theValue2Inspect)
theValue2Inspect
-
public java.lang.String formatUnsignedLong(long value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |