com.sap.mdm.valuetypes.format
Class MdmNumberFormatInfo

java.lang.Object
  extended bycom.sap.mdm.valuetypes.format.MdmNumberFormatInfo
All Implemented Interfaces:
MdmFormatInfo
Direct Known Subclasses:
MdmCurrencyFormatInfo, MdmMeasurementFormatInfo

public class MdmNumberFormatInfo
extends Object
implements MdmFormatInfo

Number format definition


Field Summary
 
Fields inherited from interface com.sap.mdm.valuetypes.format.MdmFormatInfo
CURRANCY_FORMAT_TYPE, DATE_TIME_FORMAT_TYPE, MEASUREMENT_FORMAT_TYPE, NUMBER_FORMAT_TYPE
 
Constructor Summary
MdmNumberFormatInfo()
          Empty constructor
MdmNumberFormatInfo(Locale locale)
          Constructor
MdmNumberFormatInfo(MdmNumberFormatInfo other)
          Copy constructor
 
Method Summary
 char getDecimalSeparator()
          Returns character of decimal separator If not specified, the default value is depends on Locale (ex.: '.' for English, ',' for Germany)
 String getFormatPattern()
          Returns format pattern
 int getFractionType()
          Returns the fraction type.
 char getGroupingSeparator()
          Returns character of grouping separator (ex: 1,234.5) If not specified, the default value is depends on Locale (ex.: ',' for English, '.' for Germany)
 int getGroupingSize()
          Returns size of grouping If not specified, the default value is 0
 int getIntegerDigits()
          Returns number of integer digits.
 Locale getLocale()
          Returns the locale
 int getMaxFractionDigits()
          Returns the maximum number of digits in the fractional part.
 int getMinFractionDigits()
          Returns the minimum number of digits in the fractional part.
 int getType()
          Returns type of format info
 boolean isAllowENotation()
          Indicated if the number should be formatted as scientific ('E') notation.
 boolean isTreatAsDouble()
          Indicates if the number should be treated as double number If not specified, the default value is false
 void setAllowENotation(boolean allowENotation)
          Specify if the number should be formatted as scientific ('E') notation.
 void setDecimalSeparator(char decimalSeparator)
          Sets character of decimal separator If not specified, the default value is depends on Locale (ex.: '.' for English, ',' for Germany)
 void setFormatPattern(String formatPattern)
          Sets format pattern.
 void setFractionType(int fractionType)
          Sets the fraction type.
 void setGroupingSeparator(char groupingSeparator)
          Sets character of grouping separator (ex: 1,234.5) If not specified, the default value is depends on Locale (ex.: ',' for English, '.' for Germany)
 void setGroupingSize(int groupingSize)
          Sets size of grouping If not specified, the default value is 0
 void setIntegerDigits(int integerDigits)
          Sets number of integer digits.
 void setLocale(Locale locale)
          Sets the locale
 void setMaxFractionDigits(int maxFractionDigits)
          Sets the maximum number of digits in the fractional part.
 void setMinFractionDigits(int minFractionDigits)
          Sets the minimum number of digits in the fractional part.
 void setTreatAsDouble(boolean treatAsDouble)
          Specifies if the number should be treated as double number If not specified, the default value is false
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MdmNumberFormatInfo

public MdmNumberFormatInfo()
Empty constructor


MdmNumberFormatInfo

public MdmNumberFormatInfo(Locale locale)
Constructor

Parameters:
locale -

MdmNumberFormatInfo

public MdmNumberFormatInfo(MdmNumberFormatInfo other)
Copy constructor

Method Detail

getType

public int getType()
Description copied from interface: MdmFormatInfo
Returns type of format info

Specified by:
getType in interface MdmFormatInfo
Returns:
format info type

isAllowENotation

public boolean isAllowENotation()
Indicated if the number should be formatted as scientific ('E') notation.

Returns:
true for 'E' notation, false otherwise

setAllowENotation

public void setAllowENotation(boolean allowENotation)
Specify if the number should be formatted as scientific ('E') notation. If not specified, the default value is false

Parameters:
allowENotation - true if number should be formatted in 'E' notation

getDecimalSeparator

public char getDecimalSeparator()
Returns character of decimal separator If not specified, the default value is depends on Locale (ex.: '.' for English, ',' for Germany)

Returns:
the decimal separator

setDecimalSeparator

public void setDecimalSeparator(char decimalSeparator)
Sets character of decimal separator If not specified, the default value is depends on Locale (ex.: '.' for English, ',' for Germany)

Parameters:
decimalSeparator - the decimal separator to set

getFractionType

public int getFractionType()
Returns the fraction type. There are tree types: FRACTIONS_NONE - fractions not supported FRACTIONS_OF_TWO - fractions like: 1/2, 3/4, 5/8, 7/16, 3/128 FRACTIONS_ALL - any other like: 1/5, 3/7 If not specified, the default value is UnitProperties.FRACTIONS_NONE

Returns:
the fractionType
See Also:
for possible values

setFractionType

public void setFractionType(int fractionType)
Sets the fraction type. There are tree types: FRACTIONS_NONE - fractions not supported FRACTIONS_OF_TWO - fractions like: 1/2, 3/4, 5/8, 7/16, 3/128 FRACTIONS_ALL - any other like: 1/5, 3/7 If not specified, the default value is UnitProperties.FRACTIONS_NONE

Parameters:
fractionType - the fraction type
See Also:
for possible values

getGroupingSeparator

public char getGroupingSeparator()
Returns character of grouping separator (ex: 1,234.5) If not specified, the default value is depends on Locale (ex.: ',' for English, '.' for Germany)

Returns:
the decimal separator

setGroupingSeparator

public void setGroupingSeparator(char groupingSeparator)
Sets character of grouping separator (ex: 1,234.5) If not specified, the default value is depends on Locale (ex.: ',' for English, '.' for Germany)

Parameters:
groupingSeparator - the grouping separator

getGroupingSize

public int getGroupingSize()
Returns size of grouping If not specified, the default value is 0

Returns:
the grouping size

setGroupingSize

public void setGroupingSize(int groupingSize)
Sets size of grouping If not specified, the default value is 0

Parameters:
groupingSize - the grouping size

getLocale

public Locale getLocale()
Returns the locale

Returns:
the locale

setLocale

public void setLocale(Locale locale)
Sets the locale

Parameters:
locale - the locale to set

isTreatAsDouble

public boolean isTreatAsDouble()
Indicates if the number should be treated as double number If not specified, the default value is false

Returns:
true if the number should be treated as double, false otherwise

setTreatAsDouble

public void setTreatAsDouble(boolean treatAsDouble)
Specifies if the number should be treated as double number If not specified, the default value is false

Parameters:
treatAsDouble - true if the number should be treated as double, false otherwise

getIntegerDigits

public int getIntegerDigits()
Returns number of integer digits. Relevant only for 'E' notation If not specified, the default value is 1

Returns:
the number of integer digits

setIntegerDigits

public void setIntegerDigits(int integerDigits)
Sets number of integer digits. Relevant only for 'E' notation If not specified, the default value is 1

Parameters:
integerDigits - the number of integer digits

getMaxFractionDigits

public int getMaxFractionDigits()
Returns the maximum number of digits in the fractional part. If not specified, the default value is 6 for float and 14 for double

Returns:
the maximum number of digits in the fractional part.

setMaxFractionDigits

public void setMaxFractionDigits(int maxFractionDigits)
Sets the maximum number of digits in the fractional part. If not specified, the default value is 6 for float and 14 for double

Parameters:
maxFractionDigits - the maximum number of digits in the fractional part.

getMinFractionDigits

public int getMinFractionDigits()
Returns the minimum number of digits in the fractional part. If not specified, the default value is 0.

Returns:
the minimum number of digits in the fractional part.

setMinFractionDigits

public void setMinFractionDigits(int minFractionDigits)
Sets the minimum number of digits in the fractional part. If not specified, the default value is 0.

Parameters:
minFractionDigits - the minimum number of digits in the fractional part.

getFormatPattern

public String getFormatPattern()
Returns format pattern

Returns:
the format pattern string

setFormatPattern

public void setFormatPattern(String formatPattern)
Sets format pattern. If format pattern is specified then all other definition do not influence of formatting.

Parameters:
formatPattern - the format pattern to set
See Also:
explaining structure of number format pattern


Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.