Java Doc for ChoiceFormat.java in  » Apache-Harmony-Java-SE » java-package » java » 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 » Apache Harmony Java SE » java package » java.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.text.Format
      java.text.NumberFormat
         java.text.ChoiceFormat

ChoiceFormat
public class ChoiceFormat extends NumberFormat (Code)
ChoiceFormat is used to associate strings with ranges of double values. The strings and ranges are either specified using arrays or with a pattern which is parsed to determine the Strings and ranges.



Constructor Summary
public  ChoiceFormat(double[] limits, String[] formats)
     Constructs a new ChoiceFormat with the specified ranges and associated strings.
Parameters:
  limits - an array of double, the ranges are greater or equal to thevalue in lower index up to less than the value in the nexthigher index.
public  ChoiceFormat(String template)
     Constructs a new ChoiceFormat with the strings and ranges parsed from the specified pattern.

Method Summary
public  voidapplyPattern(String template)
     Parses the pattern to determine new strings and ranges for this ChoiceFormat.
public  Objectclone()
     Answers a new instance of ChoiceFormat with the same ranges and strings as this ChoiceFormat.
public  booleanequals(Object object)
     Compares the specified object to this ChoiceFormat and answer if they are equal.
public  StringBufferformat(double value, StringBuffer buffer, FieldPosition field)
     Appends to the specified StringBuffer the string associated with the range in which the specified double value fits.
public  StringBufferformat(long value, StringBuffer buffer, FieldPosition field)
     Appends to the specified StringBuffer the string associated with the range in which the specified long value fits.
public  Object[]getFormats()
     Answers the Strings associated with the ranges of this ChoiceFormat.
public  double[]getLimits()
     Answers the ranges of this ChoiceFormat. an array of double, the ranges are greater or equal to the valuein lower index up to less than the value in the next higherindex.
public  inthashCode()
     Answers an integer hash code for the receiver.
final public static  doublenextDouble(double value)
     Answers the double value which is closest to the specified double but larger.
public static  doublenextDouble(double value, boolean increment)
     Answers the double value which is closest to the specified double but either larger or smaller as specified.
public  Numberparse(String string, ParsePosition position)
     Parse a Double from the specified String starting at the index specified by the ParsePosition.
final public static  doublepreviousDouble(double value)
     Answers the double value which is closest to the specified double but smaller.
public  voidsetChoices(double[] limits, String[] formats)
     Sets the ranges and associated strings of this ChoiceFormat.
Parameters:
  limits - an array of double, the ranges are greater or equal to thevalue in lower index up to less than the value in the nexthigher index.
public  StringtoPattern()
     Answers the pattern of this ChoiceFormat which specified the ranges and their associated strings.


Constructor Detail
ChoiceFormat
public ChoiceFormat(double[] limits, String[] formats)(Code)
Constructs a new ChoiceFormat with the specified ranges and associated strings.
Parameters:
  limits - an array of double, the ranges are greater or equal to thevalue in lower index up to less than the value in the nexthigher index. The bounds of the lowest and highest indexes arenegative and positive infinity.
Parameters:
  formats - the strings associated with the ranges. The lower bound of theassociated range is at the same index as the string.



ChoiceFormat
public ChoiceFormat(String template)(Code)
Constructs a new ChoiceFormat with the strings and ranges parsed from the specified pattern.
Parameters:
  template - the pattern of strings and ranges
exception:
  IllegalArgumentException - then an error occurs parsing the pattern




Method Detail
applyPattern
public void applyPattern(String template)(Code)
Parses the pattern to determine new strings and ranges for this ChoiceFormat.
Parameters:
  template - the pattern of strings and ranges
exception:
  IllegalArgumentException - then an error occurs parsing the pattern



clone
public Object clone()(Code)
Answers a new instance of ChoiceFormat with the same ranges and strings as this ChoiceFormat. a shallow copy of this ChoiceFormat
See Also:   java.lang.Cloneable



equals
public boolean equals(Object object)(Code)
Compares the specified object to this ChoiceFormat and answer if they are equal. The object must be an instance of ChoiceFormat and have the same limits and formats.
Parameters:
  object - the object to compare with this object true if the specified object is equal to this ChoiceFormat, falseotherwise
See Also:   ChoiceFormat.hashCode



format
public StringBuffer format(double value, StringBuffer buffer, FieldPosition field)(Code)
Appends to the specified StringBuffer the string associated with the range in which the specified double value fits.
Parameters:
  value - the double to format
Parameters:
  buffer - the StringBuffer
Parameters:
  field - a FieldPosition which is ignored the StringBuffer parameter buffer



format
public StringBuffer format(long value, StringBuffer buffer, FieldPosition field)(Code)
Appends to the specified StringBuffer the string associated with the range in which the specified long value fits.
Parameters:
  value - the long to format
Parameters:
  buffer - the StringBuffer
Parameters:
  field - a FieldPosition which is ignored the StringBuffer parameter buffer



getFormats
public Object[] getFormats()(Code)
Answers the Strings associated with the ranges of this ChoiceFormat. an array of String



getLimits
public double[] getLimits()(Code)
Answers the ranges of this ChoiceFormat. an array of double, the ranges are greater or equal to the valuein lower index up to less than the value in the next higherindex. The bounds of the lowest and highest indexes are negativeand positive infinity.



hashCode
public int hashCode()(Code)
Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method. the receiver's hash
See Also:   ChoiceFormat.equals



nextDouble
final public static double nextDouble(double value)(Code)
Answers the double value which is closest to the specified double but larger.
Parameters:
  value - a double value the next larger double value



nextDouble
public static double nextDouble(double value, boolean increment)(Code)
Answers the double value which is closest to the specified double but either larger or smaller as specified.
Parameters:
  value - a double value
Parameters:
  increment - true to get a larger value, false to get a smaller value the next larger or smaller double value



parse
public Number parse(String string, ParsePosition position)(Code)
Parse a Double from the specified String starting at the index specified by the ParsePosition. The String is compared to the strings of this ChoiceFormat and if a match occurs, the answer is the lower bound of the corresponding range. If the string is successfully parsed, the index of the ParsePosition is updated to the index following the parsed text.
Parameters:
  string - the String to parse
Parameters:
  position - the ParsePosition, updated on return with the index followingthe parsed text, or on error the index is unchanged and theerror index is set to the index where the error occurred a Double resulting from the parse, or Double.NaN if there is anerror



previousDouble
final public static double previousDouble(double value)(Code)
Answers the double value which is closest to the specified double but smaller.
Parameters:
  value - a double value the next smaller double value



setChoices
public void setChoices(double[] limits, String[] formats)(Code)
Sets the ranges and associated strings of this ChoiceFormat.
Parameters:
  limits - an array of double, the ranges are greater or equal to thevalue in lower index up to less than the value in the nexthigher index. The bounds of the lowest and highest indexes arenegative and positive infinity.
Parameters:
  formats - the strings associated with the ranges. The lower bound of therange is at the same index as the string.



toPattern
public String toPattern()(Code)
Answers the pattern of this ChoiceFormat which specified the ranges and their associated strings. the pattern



Fields inherited from java.text.NumberFormat
final public static int FRACTION_FIELD(Code)(Java Doc)
final public static int INTEGER_FIELD(Code)(Java Doc)

Methods inherited from java.text.NumberFormat
public Object clone()(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
final public String format(double value)(Code)(Java Doc)
abstract public StringBuffer format(double value, StringBuffer buffer, FieldPosition field)(Code)(Java Doc)
final public String format(long value)(Code)(Java Doc)
abstract public StringBuffer format(long value, StringBuffer buffer, FieldPosition field)(Code)(Java Doc)
public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code)(Java Doc)
public static Locale[] getAvailableLocales()(Code)(Java Doc)
public Currency getCurrency()(Code)(Java Doc)
final public static NumberFormat getCurrencyInstance()(Code)(Java Doc)
public static NumberFormat getCurrencyInstance(Locale locale)(Code)(Java Doc)
final public static NumberFormat getInstance()(Code)(Java Doc)
public static NumberFormat getInstance(Locale locale)(Code)(Java Doc)
final public static NumberFormat getIntegerInstance()(Code)(Java Doc)
public static NumberFormat getIntegerInstance(Locale locale)(Code)(Java Doc)
public int getMaximumFractionDigits()(Code)(Java Doc)
public int getMaximumIntegerDigits()(Code)(Java Doc)
public int getMinimumFractionDigits()(Code)(Java Doc)
public int getMinimumIntegerDigits()(Code)(Java Doc)
final public static NumberFormat getNumberInstance()(Code)(Java Doc)
public static NumberFormat getNumberInstance(Locale locale)(Code)(Java Doc)
final public static NumberFormat getPercentInstance()(Code)(Java Doc)
public static NumberFormat getPercentInstance(Locale locale)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isGroupingUsed()(Code)(Java Doc)
public boolean isParseIntegerOnly()(Code)(Java Doc)
public Number parse(String string) throws ParseException(Code)(Java Doc)
abstract public Number parse(String string, ParsePosition position)(Code)(Java Doc)
final public Object parseObject(String string, ParsePosition position)(Code)(Java Doc)
public void setCurrency(Currency currency)(Code)(Java Doc)
public void setGroupingUsed(boolean value)(Code)(Java Doc)
public void setMaximumFractionDigits(int value)(Code)(Java Doc)
public void setMaximumIntegerDigits(int value)(Code)(Java Doc)
public void setMinimumFractionDigits(int value)(Code)(Java Doc)
public void setMinimumIntegerDigits(int value)(Code)(Java Doc)
public void setParseIntegerOnly(boolean value)(Code)(Java Doc)

Methods inherited from java.text.Format
public Object clone()(Code)(Java Doc)
String convertPattern(String template, String fromChars, String toChars, boolean check)(Code)(Java Doc)
final public String format(Object object)(Code)(Java Doc)
abstract public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code)(Java Doc)
public AttributedCharacterIterator formatToCharacterIterator(Object object)(Code)(Java Doc)
static Object getInternalField(String fieldName, Object target)(Code)(Java Doc)
public Object parseObject(String string) throws ParseException(Code)(Java Doc)
abstract public Object parseObject(String string, ParsePosition position)(Code)(Java Doc)
static boolean upTo(String string, ParsePosition position, StringBuffer buffer, char stop)(Code)(Java Doc)
static boolean upToWithQuotes(String string, ParsePosition position, StringBuffer buffer, char stop, char start)(Code)(Java Doc)

Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.