Java Doc for SimpleDateFormat.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.DateFormat
         java.text.SimpleDateFormat

SimpleDateFormat
public class SimpleDateFormat extends DateFormat (Code)
SimpleDateFormat is used to format and parse Gregorian calendar dates and times based on a pattern of date and time fields. Each date and time field is specified in the pattern by a specific character. The characters used can be either localized or non-localized. For some fields, which have both numeric and text representations or abbreviated as well as full names, the number of grouped characters specifies how the field is formatted or parsed.



Constructor Summary
public  SimpleDateFormat()
     Constructs a new SimpleDateFormat for formatting and parsing dates and times in the SHORT style for the default Locale.
public  SimpleDateFormat(String pattern)
     Constructs a new SimpleDateFormat using the specified non-localized pattern and the DateFormatSymbols and Calendar for the default Locale.
public  SimpleDateFormat(String template, DateFormatSymbols value)
     Constructs a new SimpleDateFormat using the specified non-localized pattern and DateFormatSymbols and the Calendar for the default Locale.
public  SimpleDateFormat(String template, Locale locale)
     Constructs a new SimpleDateFormat using the specified non-localized pattern and the DateFormatSymbols and Calendar for the specified Locale.
 SimpleDateFormat(Locale locale, com.ibm.icu.text.SimpleDateFormat icuFormat)
    

Method Summary
public  voidapplyLocalizedPattern(String template)
     Changes the pattern of this SimpleDateFormat to the specified pattern which uses localized pattern characters.
public  voidapplyPattern(String template)
     Changes the pattern of this SimpleDateFormat to the specified pattern which uses non-localized pattern characters.
public  Objectclone()
     Answers a new SimpleDateFormat with the same pattern and properties as this SimpleDateFormat.
public  booleanequals(Object object)
     Compares the specified object to this SimpleDateFormat and answer if they are equal.
public  StringBufferformat(Date date, StringBuffer buffer, FieldPosition field)
     Formats the specified Date into the specified StringBuffer using the pattern of this SimpleDateFormat.
public  AttributedCharacterIteratorformatToCharacterIterator(Object object)
     Formats the specified object using the rules of this SimpleDateFormat and returns an AttributedCharacterIterator with the formatted Date and attributes.
public  Dateget2DigitYearStart()
     Answers the Date which is the start of the one hundred year period for two digits year values.
public  DateFormatSymbolsgetDateFormatSymbols()
     Answers the DateFormatSymbols used by this SimpleDateFormat.
public  inthashCode()
     Answers an integer hash code for the receiver.
public  Dateparse(String string, ParsePosition position)
     Parse a Date from the specified String starting at the index specified by the ParsePosition.
public  voidset2DigitYearStart(Date date)
     Sets the Date which is the start of the one hundred year period for two digits year values.
public  voidsetDateFormatSymbols(DateFormatSymbols value)
     Sets the DateFormatSymbols used by this SimpleDateFormat.
public  StringtoLocalizedPattern()
     Answers the pattern of this SimpleDateFormat using localized pattern characters.
public  StringtoPattern()
     Answers the pattern of this SimpleDateFormat using non-localized pattern characters.


Constructor Detail
SimpleDateFormat
public SimpleDateFormat()(Code)
Constructs a new SimpleDateFormat for formatting and parsing dates and times in the SHORT style for the default Locale.



SimpleDateFormat
public SimpleDateFormat(String pattern)(Code)
Constructs a new SimpleDateFormat using the specified non-localized pattern and the DateFormatSymbols and Calendar for the default Locale.
Parameters:
  pattern - the pattern
exception:
  NullPointerException - if a null value of patternis supplied.
exception:
  IllegalArgumentException - if pattern is not considered to be useableby this formatter.



SimpleDateFormat
public SimpleDateFormat(String template, DateFormatSymbols value)(Code)
Constructs a new SimpleDateFormat using the specified non-localized pattern and DateFormatSymbols and the Calendar for the default Locale.
Parameters:
  template - the pattern
Parameters:
  value - the DateFormatSymbols
exception:
  NullPointerException - if the pattern is null
exception:
  IllegalArgumentException - if the pattern is invalid



SimpleDateFormat
public SimpleDateFormat(String template, Locale locale)(Code)
Constructs a new SimpleDateFormat using the specified non-localized pattern and the DateFormatSymbols and Calendar for the specified Locale.
Parameters:
  template - the pattern
Parameters:
  locale - the Locale
exception:
  NullPointerException - if the pattern is null
exception:
  IllegalArgumentException - if the pattern is invalid



SimpleDateFormat
SimpleDateFormat(Locale locale, com.ibm.icu.text.SimpleDateFormat icuFormat)(Code)




Method Detail
applyLocalizedPattern
public void applyLocalizedPattern(String template)(Code)
Changes the pattern of this SimpleDateFormat to the specified pattern which uses localized pattern characters.
Parameters:
  template - the localized pattern



applyPattern
public void applyPattern(String template)(Code)
Changes the pattern of this SimpleDateFormat to the specified pattern which uses non-localized pattern characters.
Parameters:
  template - the non-localized pattern
exception:
  NullPointerException - if the pattern is null
exception:
  IllegalArgumentException - if the pattern is invalid



clone
public Object clone()(Code)
Answers a new SimpleDateFormat with the same pattern and properties as this SimpleDateFormat. a shallow copy of this SimpleDateFormat
See Also:   java.lang.Cloneable



equals
public boolean equals(Object object)(Code)
Compares the specified object to this SimpleDateFormat and answer if they are equal. The object must be an instance of SimpleDateFormat and have the same DateFormat properties, pattern, DateFormatSymbols, and creation year.
Parameters:
  object - the object to compare with this object true if the specified object is equal to this SimpleDateFormat,false otherwise
See Also:   SimpleDateFormat.hashCode



format
public StringBuffer format(Date date, StringBuffer buffer, FieldPosition field)(Code)
Formats the specified Date into the specified StringBuffer using the pattern of this SimpleDateFormat. If the field specified by the FieldPosition is formatted, set the begin and end index of the formatted field in the FieldPosition.
Parameters:
  date - the Date to format
Parameters:
  buffer - the StringBuffer
Parameters:
  field - the FieldPosition the StringBuffer parameter buffer
exception:
  IllegalArgumentException - when there are invalid characters in the pattern



formatToCharacterIterator
public AttributedCharacterIterator formatToCharacterIterator(Object object)(Code)
Formats the specified object using the rules of this SimpleDateFormat and returns an AttributedCharacterIterator with the formatted Date and attributes.
Parameters:
  object - the object to format an AttributedCharacterIterator with the formatted date andattributes
exception:
  NullPointerException - when the object is null
exception:
  IllegalArgumentException - when the object cannot be formatted by this Format



get2DigitYearStart
public Date get2DigitYearStart()(Code)
Answers the Date which is the start of the one hundred year period for two digits year values. a Date



getDateFormatSymbols
public DateFormatSymbols getDateFormatSymbols()(Code)
Answers the DateFormatSymbols used by this SimpleDateFormat. a DateFormatSymbols



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:   SimpleDateFormat.equals



parse
public Date parse(String string, ParsePosition position)(Code)
Parse a Date from the specified String starting at the index specified by the ParsePosition. 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 according to the pattern of thisSimpleDateFormat
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 the Date resulting from the parse, or null if there is an error
exception:
  IllegalArgumentException - when there are invalid characters in the pattern



set2DigitYearStart
public void set2DigitYearStart(Date date)(Code)
Sets the Date which is the start of the one hundred year period for two digits year values.
Parameters:
  date - the Date



setDateFormatSymbols
public void setDateFormatSymbols(DateFormatSymbols value)(Code)
Sets the DateFormatSymbols used by this SimpleDateFormat.
Parameters:
  value - the DateFormatSymbols



toLocalizedPattern
public String toLocalizedPattern()(Code)
Answers the pattern of this SimpleDateFormat using localized pattern characters. the localized pattern



toPattern
public String toPattern()(Code)
Answers the pattern of this SimpleDateFormat using non-localized pattern characters. the non-localized pattern



Fields inherited from java.text.DateFormat
final public static int AM_PM_FIELD(Code)(Java Doc)
final public static int DATE_FIELD(Code)(Java Doc)
final public static int DAY_OF_WEEK_FIELD(Code)(Java Doc)
final public static int DAY_OF_WEEK_IN_MONTH_FIELD(Code)(Java Doc)
final public static int DAY_OF_YEAR_FIELD(Code)(Java Doc)
final public static int DEFAULT(Code)(Java Doc)
final public static int ERA_FIELD(Code)(Java Doc)
final public static int FULL(Code)(Java Doc)
final public static int HOUR0_FIELD(Code)(Java Doc)
final public static int HOUR1_FIELD(Code)(Java Doc)
final public static int HOUR_OF_DAY0_FIELD(Code)(Java Doc)
final public static int HOUR_OF_DAY1_FIELD(Code)(Java Doc)
final public static int LONG(Code)(Java Doc)
final public static int MEDIUM(Code)(Java Doc)
final public static int MILLISECOND_FIELD(Code)(Java Doc)
final public static int MINUTE_FIELD(Code)(Java Doc)
final public static int MONTH_FIELD(Code)(Java Doc)
final public static int SECOND_FIELD(Code)(Java Doc)
final public static int SHORT(Code)(Java Doc)
final public static int TIMEZONE_FIELD(Code)(Java Doc)
final public static int WEEK_OF_MONTH_FIELD(Code)(Java Doc)
final public static int WEEK_OF_YEAR_FIELD(Code)(Java Doc)
final public static int YEAR_FIELD(Code)(Java Doc)
protected Calendar calendar(Code)(Java Doc)
protected NumberFormat numberFormat(Code)(Java Doc)

Methods inherited from java.text.DateFormat
public Object clone()(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
final public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code)(Java Doc)
final public String format(Date date)(Code)(Java Doc)
abstract public StringBuffer format(Date date, StringBuffer buffer, FieldPosition field)(Code)(Java Doc)
public static Locale[] getAvailableLocales()(Code)(Java Doc)
public Calendar getCalendar()(Code)(Java Doc)
final public static DateFormat getDateInstance()(Code)(Java Doc)
final public static DateFormat getDateInstance(int style)(Code)(Java Doc)
final public static DateFormat getDateInstance(int style, Locale locale)(Code)(Java Doc)
final public static DateFormat getDateTimeInstance()(Code)(Java Doc)
final public static DateFormat getDateTimeInstance(int dateStyle, int timeStyle)(Code)(Java Doc)
final public static DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale)(Code)(Java Doc)
final public static DateFormat getInstance()(Code)(Java Doc)
public NumberFormat getNumberFormat()(Code)(Java Doc)
static String getStyleName(int style)(Code)(Java Doc)
final public static DateFormat getTimeInstance()(Code)(Java Doc)
final public static DateFormat getTimeInstance(int style)(Code)(Java Doc)
final public static DateFormat getTimeInstance(int style, Locale locale)(Code)(Java Doc)
public TimeZone getTimeZone()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isLenient()(Code)(Java Doc)
public Date parse(String string) throws ParseException(Code)(Java Doc)
abstract public Date parse(String string, ParsePosition position)(Code)(Java Doc)
public Object parseObject(String string, ParsePosition position)(Code)(Java Doc)
public void setCalendar(Calendar cal)(Code)(Java Doc)
public void setLenient(boolean value)(Code)(Java Doc)
public void setNumberFormat(NumberFormat format)(Code)(Java Doc)
public void setTimeZone(TimeZone timezone)(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.