Java Doc for DigitList.java in  » Internationalization-Localization » icu4j » com » ibm » icu » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Internationalization Localization » icu4j » com.ibm.icu.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.icu.text.DigitList

DigitList
final class DigitList (Code)
DigitList handles the transcoding between numeric values and strings of characters. It only represents non-negative numbers. The division of labor between DigitList and DecimalFormat is that DigitList handles the radix 10 representation issues and numeric conversion, including rounding; DecimalFormat handles the locale-specific issues such as positive and negative representation, digit grouping, decimal point, currency, and so on.

A DigitList is a representation of a finite numeric value. DigitList objects do not represent NaN or infinite values. A DigitList value can be converted to a BigDecimal without loss of precision. Conversion to other numeric formats may involve loss of precision, depending on the specific value.

The DigitList representation consists of a string of characters, which are the digits radix 10, from '0' to '9'. It also has a base 10 exponent associated with it. The value represented by a DigitList object can be computed by mulitplying the fraction f, where 0 <= f < 1, derived by placing all the digits of the list to the right of the decimal point, by 10^exponent.
See Also:   java.util.Locale
See Also:   java.text.Format
See Also:   NumberFormat
See Also:   DecimalFormat
See Also:   java.text.ChoiceFormat
See Also:   java.text.MessageFormat
version:
   1.18 08/12/98
author:
   Mark Davis, Alan Liu



Field Summary
final public static  intDBL_DIG
    
final public static  intMAX_LONG_DIGITS
     The maximum number of significant digits in an IEEE 754 double, that is, in a Java double.
public  intcount
    
public  intdecimalAt
     These data members are intentionally public and can be set directly. The value represented is given by placing the decimal point before digits[decimalAt].
public  byte[]digits
    


Method Summary
public  voidappend(int digit)
     Appends digits to the list.
public  booleanequals(Object obj)
     equality test between two digit lists.
public  java.math.BigDecimalgetBigDecimal(boolean isPositive)
     Return a BigDecimal representing the value stored in this DigitList.
public  com.ibm.icu.math.BigDecimalgetBigDecimalICU(boolean isPositive)
     Return an ICU BigDecimal representing the value stored in this DigitList.
public  BigIntegergetBigInteger(boolean isPositive)
     Return a BigInteger representing the value stored in this DigitList.
final public  doublegetDouble()
     Utility routine to get the value of the digit list If (count == 0) this throws a NumberFormatException, which mimics Long.parseLong().
final public  longgetLong()
     Utility routine to get the value of the digit list.
public  inthashCode()
     Generates the hash code for the digit list.
 booleanisIntegral()
     Return whether or not this objects represented value is an integer.
 booleanisZero()
     Return true if the represented number is zero.
final public  voidround(int maximumDigits)
     Round the representation to the given number of digits.
final  voidset(double source, int maximumDigits, boolean fixedPoint)
     Set the digit list to a representation of the given double value. This method supports both fixed-point and exponential notation.
Parameters:
  source - Value to be converted; must not be Inf, -Inf, Nan,or a value <= 0.
Parameters:
  maximumDigits - The most fractional or total digits which shouldbe converted.
Parameters:
  fixedPoint - If true, then maximumDigits is the maximumfractional digits to be converted.
final public  voidset(long source)
    
final public  voidset(long source, int maximumDigits)
     Set the digit list to a representation of the given long value.
Parameters:
  source - Value to be converted; must be >= 0 or ==Long.MIN_VALUE.
Parameters:
  maximumDigits - The most digits which should be converted.If maximumDigits is lower than the number of significant digitsin source, the representation will be rounded.
final public  voidset(BigInteger source, int maximumDigits)
     Set the digit list to a representation of the given BigInteger value. [bnf]
Parameters:
  source - Value to be converted
Parameters:
  maximumDigits - The most digits which should be converted.If maximumDigits is lower than the number of significant digitsin source, the representation will be rounded.
final public  voidset(java.math.BigDecimal source, int maximumDigits, boolean fixedPoint)
     Set the digit list to a representation of the given BigDecimal value. [bnf]
Parameters:
  source - Value to be converted
Parameters:
  maximumDigits - The most digits which should be converted.If maximumDigits is lower than the number of significant digitsin source, the representation will be rounded.
final public  voidset(com.ibm.icu.math.BigDecimal source, int maximumDigits, boolean fixedPoint)
    
public  StringtoString()
    

Field Detail
DBL_DIG
final public static int DBL_DIG(Code)



MAX_LONG_DIGITS
final public static int MAX_LONG_DIGITS(Code)
The maximum number of significant digits in an IEEE 754 double, that is, in a Java double. This must not be increased, or garbage digits will be generated, and should not be decreased, or accuracy will be lost.



count
public int count(Code)



decimalAt
public int decimalAt(Code)
These data members are intentionally public and can be set directly. The value represented is given by placing the decimal point before digits[decimalAt]. If decimalAt is < 0, then leading zeros between the decimal point and the first nonzero digit are implied. If decimalAt is > count, then trailing zeros between the digits[count-1] and the decimal point are implied. Equivalently, the represented value is given by f * 10^decimalAt. Here f is a value 0.1 <= f < 1 arrived at by placing the digits in Digits to the right of the decimal. DigitList is normalized, so if it is non-zero, figits[0] is non-zero. We don't allow denormalized numbers because our exponent is effectively of unlimited magnitude. The count value contains the number of significant digits present in digits[]. Zero is represented by any DigitList with count == 0 or with each digits[i] for all i <= count == '0'.



digits
public byte[] digits(Code)





Method Detail
append
public void append(int digit)(Code)
Appends digits to the list.



equals
public boolean equals(Object obj)(Code)
equality test between two digit lists.



getBigDecimal
public java.math.BigDecimal getBigDecimal(boolean isPositive)(Code)
Return a BigDecimal representing the value stored in this DigitList. [bnf]
Parameters:
  isPositive - determines the sign of the returned result the value of this object as a BigDecimal



getBigDecimalICU
public com.ibm.icu.math.BigDecimal getBigDecimalICU(boolean isPositive)(Code)
Return an ICU BigDecimal representing the value stored in this DigitList. [bnf]
Parameters:
  isPositive - determines the sign of the returned result the value of this object as a BigDecimal



getBigInteger
public BigInteger getBigInteger(boolean isPositive)(Code)
Return a BigInteger representing the value stored in this DigitList. This method assumes that this object contains an integral value; if not, it will return an incorrect value. [bnf]
Parameters:
  isPositive - determines the sign of the returned result the value of this object as a BigInteger



getDouble
final public double getDouble()(Code)
Utility routine to get the value of the digit list If (count == 0) this throws a NumberFormatException, which mimics Long.parseLong().



getLong
final public long getLong()(Code)
Utility routine to get the value of the digit list. If (count == 0) this returns 0, unlike Long.parseLong().



hashCode
public int hashCode()(Code)
Generates the hash code for the digit list.



isIntegral
boolean isIntegral()(Code)
Return whether or not this objects represented value is an integer. [bnf] true if the represented value of this object is an integer



isZero
boolean isZero()(Code)
Return true if the represented number is zero.



round
final public void round(int maximumDigits)(Code)
Round the representation to the given number of digits.
Parameters:
  maximumDigits - The maximum number of digits to be shown.Upon return, count will be less than or equal to maximumDigits.This now performs rounding when maximumDigits is 0, formerly it did not.



set
final void set(double source, int maximumDigits, boolean fixedPoint)(Code)
Set the digit list to a representation of the given double value. This method supports both fixed-point and exponential notation.
Parameters:
  source - Value to be converted; must not be Inf, -Inf, Nan,or a value <= 0.
Parameters:
  maximumDigits - The most fractional or total digits which shouldbe converted.
Parameters:
  fixedPoint - If true, then maximumDigits is the maximumfractional digits to be converted. If false, total digits.



set
final public void set(long source)(Code)
Utility routine to set the value of the digit list from a long



set
final public void set(long source, int maximumDigits)(Code)
Set the digit list to a representation of the given long value.
Parameters:
  source - Value to be converted; must be >= 0 or ==Long.MIN_VALUE.
Parameters:
  maximumDigits - The most digits which should be converted.If maximumDigits is lower than the number of significant digitsin source, the representation will be rounded. Ignored if <= 0.



set
final public void set(BigInteger source, int maximumDigits)(Code)
Set the digit list to a representation of the given BigInteger value. [bnf]
Parameters:
  source - Value to be converted
Parameters:
  maximumDigits - The most digits which should be converted.If maximumDigits is lower than the number of significant digitsin source, the representation will be rounded. Ignored if <= 0.



set
final public void set(java.math.BigDecimal source, int maximumDigits, boolean fixedPoint)(Code)
Set the digit list to a representation of the given BigDecimal value. [bnf]
Parameters:
  source - Value to be converted
Parameters:
  maximumDigits - The most digits which should be converted.If maximumDigits is lower than the number of significant digitsin source, the representation will be rounded. Ignored if <= 0.
Parameters:
  fixedPoint - If true, then maximumDigits is the maximumfractional digits to be converted. If false, total digits.



set
final public void set(com.ibm.icu.math.BigDecimal source, int maximumDigits, boolean fixedPoint)(Code)



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.