com.sigh.utils.strings
Class OutputSeparatorsForDigitStrings

java.lang.Object
  extended by com.sigh.utils.SIGH_license
      extended by com.sigh.utils.strings.OutputSeparatorsForDigitStrings
Direct Known Subclasses:
ThreeDigitSeparator

public abstract class OutputSeparatorsForDigitStrings
extends SIGH_license

Author:
Software Industry & General Hardware

Constructor Summary
OutputSeparatorsForDigitStrings()
          Constructor currently initializes the values used in the United States of America
 
Method Summary
 java.lang.String get3DigitSeparatorString()
          author Software Industry & General Hardware
 java.lang.String getFractionalSeparatorString()
          author Software Industry & General Hardware
 int getNumberOfDigitsToSeparate()
          author Software Industry & General Hardware
 java.lang.String set3DigitSeparatorChar(char nxtSeparator)
          author Software Industry & General Hardware
 java.lang.String set3DigitSeparatorChar(java.lang.String nxtSeparator)
          author Software Industry & General Hardware
 java.lang.String setFractionalSeparatorChar(char nxtFractionalSeparator)
          Set the Fractional Separator Character string if user supplied string is not empty.
 java.lang.String setFractionalSeparatorChar(java.lang.String nxtFractionalSeparator)
          author Software Industry & General Hardware
 void setLocalLocaleFor3DigitSeparator()
          author Software Industry & General Hardware Sets the 3-digit separator used in the integer portion of a number.
 void setLocalLocaleForBothSeparators()
          author Software Industry & General Hardware Sets (or resets) the local Locale separator characters.
 void setLocalLocaleForFractionalSeparator()
          author Software Industry & General Hardware Sets the fractional separator: that is the separator between the integer and decimal values.
 void setLocalLocaleForGroupingCount()
          author Software Industry & General Hardware Sets the number of digits to group together.
 int setNumberOfDigitsToSeparate(int numOfDigits)
          author Software Industry & General Hardware
 
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

OutputSeparatorsForDigitStrings

public OutputSeparatorsForDigitStrings()
Constructor currently initializes the values used in the United States of America

Method Detail

setNumberOfDigitsToSeparate

public int setNumberOfDigitsToSeparate(int numOfDigits)
author Software Industry & General Hardware

Parameters:
numOfDigits -
Returns:
The previous value of the number of digits to separate. Normally digits are grouped into 3-digit groups before a new group is started as in 9,123,456,789. But this is an arbitrary grouping value. You can change that to any value you want from 0..32,767. Negative values are cast to absolute value before using. A value of zero is ignored.

getNumberOfDigitsToSeparate

public int getNumberOfDigitsToSeparate()
author Software Industry & General Hardware

Returns:
Returns the value of

get3DigitSeparatorString

public java.lang.String get3DigitSeparatorString()
author Software Industry & General Hardware

Returns:
The current string value of the digit grouping separator.

getFractionalSeparatorString

public java.lang.String getFractionalSeparatorString()
author Software Industry & General Hardware

Returns:
The current string value of the 3-digit separator.

set3DigitSeparatorChar

public java.lang.String set3DigitSeparatorChar(java.lang.String nxtSeparator)
author Software Industry & General Hardware

Parameters:
nxtSeparator -
Returns:
previous string value of the separator This routine allows the user to set the 3-digit character separator value to whatever they want. In the United States of America this is a comma as in 123,456,789 In the United Kingdom this is a period as in 123.456.789 See setFractionalSeperatorChar for an equivalent routine to change the fractional separator. Note: The separator is a string and could be multiple characters if the user desires. Try set3DigitSeperatorChar ( "\|/" ); This change lasts until it is reset or the program is restarted (where the local locale is used as the default).

set3DigitSeparatorChar

public java.lang.String set3DigitSeparatorChar(char nxtSeparator)
author Software Industry & General Hardware

Parameters:
nxtSeparator -
Returns:
previous string value of the separator This routine allows the user to set the 3-digit character separator value using a character instead of a string. In the United States of America this is a comma as in 123,456,789 In the United Kingdom this is a period as in 123.456.789 See setFractionalSeperatorChar for an equivalent routine to change the fractional separator.

setFractionalSeparatorChar

public java.lang.String setFractionalSeparatorChar(java.lang.String nxtFractionalSeparator)
author Software Industry & General Hardware

Parameters:
nxtFractionalSeparator -
Returns:
String This method allows the user to set the fractional separator value to whatever string they want.

setFractionalSeparatorChar

public java.lang.String setFractionalSeparatorChar(char nxtFractionalSeparator)
Set the Fractional Separator Character string if user supplied string is not empty.

Parameters:
nxtFractionalSeparator -
Returns:
String

setLocalLocaleForFractionalSeparator

public void setLocalLocaleForFractionalSeparator()
author Software Industry & General Hardware Sets the fractional separator: that is the separator between the integer and decimal values. In North America this is usually a period. In Europe this is usually a comma.


setLocalLocaleFor3DigitSeparator

public void setLocalLocaleFor3DigitSeparator()
author Software Industry & General Hardware Sets the 3-digit separator used in the integer portion of a number. In North America this is usually a comma. In Europe this is usually a period.


setLocalLocaleForGroupingCount

public void setLocalLocaleForGroupingCount()
author Software Industry & General Hardware Sets the number of digits to group together. In Western European culture countries this is usually 3-digits.


setLocalLocaleForBothSeparators

public void setLocalLocaleForBothSeparators()
author Software Industry & General Hardware Sets (or resets) the local Locale separator characters.