Java Doc for DateValue.java in  » XML » saxonb » net » sf » saxon » value » 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 » XML » saxonb » net.sf.saxon.value 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.saxon.value.Value
      net.sf.saxon.value.AtomicValue
         net.sf.saxon.value.CalendarValue
            net.sf.saxon.value.DateValue

All known Subclasses:   net.sf.saxon.value.GYearValue,  net.sf.saxon.value.GYearMonthValue,  net.sf.saxon.value.GMonthDayValue,  net.sf.saxon.value.GMonthValue,  net.sf.saxon.value.GDayValue,
DateValue
public class DateValue extends CalendarValue (Code)
A value of type Date. Note that a Date may include a TimeZone.


Field Summary
protected  byteday
    
protected  bytemonth
    
protected  intyear
    

Constructor Summary
protected  DateValue()
    
protected  DateValue(int year, byte month, byte day)
     Constructor given a year, month, and day.
protected  DateValue(int year, byte month, byte day, int tz)
     Constructor given a year, month, and day, and timezone.
public  DateValue(CharSequence s)
    
public  DateValue(GregorianCalendar calendar, int tz)
    

Method Summary
public  CalendarValueadd(DurationValue duration)
    
public  CalendarValueadjustTimezone(int timezone)
     Return a new date with the same normalized value, but in a different timezone.
public  intcompareTo(Object other)
     Compare the value to another date value.
public  intcompareTo(CalendarValue other, XPathContext context)
     Compare this value to another value of the same type, using the supplied context object to get the implicit timezone if required.
public  AtomicValueconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
    
public  ObjectconvertToJava(Class target, XPathContext context)
    
public  CalendarValuecopy()
    
public static  DateValuedateFromJulianDayNumber(int julianDayNumber)
     Get the Gregorian date corresponding to a particular Julian day number.
public  booleanequals(Object other)
    
public  GregorianCalendargetCalendar()
    
public  AtomicValuegetComponent(int component)
     Get a component of the value.
public  bytegetDay()
    
final public static  intgetDayOfWeek(int year, int month, int day)
     Get the day of the week.
final public static  intgetDayWithinYear(int year, int month, int day)
    
public  ItemTypegetItemType(TypeHierarchy th)
    
public static  intgetJulianDayNumber(int year, int month, int day)
     Calculate the Julian day number at 00:00 on a given date.
public  bytegetMonth()
    
public  CharSequencegetStringValueCS()
    
final public static  intgetWeekNumber(int year, int month, int day)
     Get the ISO week number for a given date.
final public static  intgetWeekNumberWithinMonth(int year, int month, int day)
     Get the week number within a month.
public  intgetYear()
    
public  inthashCode()
    
public static  booleanisLeapYear(int year)
    
public static  booleanisValidDate(int year, int month, int day)
    
public static  voidmain(String[] args)
    
public  voidsetLexicalValue(CharSequence s)
     Initialize the DateValue using a character string in the format yyyy-mm-dd and an optional time zone.
public  SecondsDurationValuesubtract(CalendarValue other, XPathContext context)
    
public  DateTimeValuetoDateTime()
    
public static  DateValuetomorrow(int year, byte month, byte day)
    
public static  DateValueyesterday(int year, byte month, byte day)
    

Field Detail
day
protected byte day(Code)



month
protected byte month(Code)



year
protected int year(Code)




Constructor Detail
DateValue
protected DateValue()(Code)
Default constructor needed for subtyping



DateValue
protected DateValue(int year, byte month, byte day)(Code)
Constructor given a year, month, and day. Performs no validation.



DateValue
protected DateValue(int year, byte month, byte day, int tz)(Code)
Constructor given a year, month, and day, and timezone. Performs no validation.



DateValue
public DateValue(CharSequence s) throws XPathException(Code)
Constructor: create a dateTime value from a supplied string, in ISO 8601 format



DateValue
public DateValue(GregorianCalendar calendar, int tz)(Code)
Create a DateValue
Parameters:
  calendar - the absolute date/time value
Parameters:
  tz - the timezone offset from UTC in minutes




Method Detail
add
public CalendarValue add(DurationValue duration) throws XPathException(Code)
Add a duration to a date
Parameters:
  duration - the duration to be added (may be negative) the new date
throws:
  net.sf.saxon.trans.XPathException - if the duration is an xs:duration, as distinct froma subclass thereof



adjustTimezone
public CalendarValue adjustTimezone(int timezone)(Code)
Return a new date with the same normalized value, but in a different timezone. This is called only for a DateValue that has an explicit timezone
Parameters:
  timezone - the new timezone offset, in minutes the time in the new timezone. This will be a new TimeValue unless no changewas required to the original value



compareTo
public int compareTo(Object other)(Code)
Compare the value to another date value. This method is used only during schema processing, and uses XML Schema semantics rather than XPath semantics.
Parameters:
  other - The other date value. Must be an object of class DateValue. negative value if this one is the earlier, 0 if they are chronologically equal,positive value if this one is the later. For this purpose, dateTime values with an unknowntimezone are considered to be UTC values (the Comparable interface requiresa total ordering).
throws:
  ClassCastException - if the other value is not a DateValue (the parameteris declared as Object to satisfy the Comparable interface)



compareTo
public int compareTo(CalendarValue other, XPathContext context)(Code)
Compare this value to another value of the same type, using the supplied context object to get the implicit timezone if required. This method implements the XPath comparison semantics.



convertPrimitive
public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)(Code)
Convert to target data type
Parameters:
  requiredType - an integer identifying the required atomic type
Parameters:
  context - an AtomicValue, a value of the required type; or an ErrorValue



convertToJava
public Object convertToJava(Class target, XPathContext context) throws XPathException(Code)
Convert to Java object (for passing to external functions)



copy
public CalendarValue copy()(Code)
Make a copy of this date, time, or dateTime value



dateFromJulianDayNumber
public static DateValue dateFromJulianDayNumber(int julianDayNumber)(Code)
Get the Gregorian date corresponding to a particular Julian day number. The algorithm is taken from http://www.hermetic.ch/cal_stud/jdn.htm#comp a DateValue with no timezone information set



equals
public boolean equals(Object other)(Code)



getCalendar
public GregorianCalendar getCalendar()(Code)



getComponent
public AtomicValue getComponent(int component) throws XPathException(Code)
Get a component of the value. Returns null if the timezone component is requested and is not present.



getDay
public byte getDay()(Code)
Get the day component of the date (in local form)



getDayOfWeek
final public static int getDayOfWeek(int year, int month, int day)(Code)
Get the day of the week. The days of the week are numbered from 1 (Monday) to 7 (Sunday)



getDayWithinYear
final public static int getDayWithinYear(int year, int month, int day)(Code)
Get the ordinal day number within the year (1 Jan = 1, 1 Feb = 32, etc)



getItemType
public ItemType getItemType(TypeHierarchy th)(Code)
Determine the data type of the expression Type.DATE_TYPE,
Parameters:
  th -



getJulianDayNumber
public static int getJulianDayNumber(int year, int month, int day)(Code)
Calculate the Julian day number at 00:00 on a given date. This algorithm is taken from http://vsg.cape.com/~pbaum/date/jdalg.htm and http://vsg.cape.com/~pbaum/date/jdalg2.htm (adjusted to handle BC dates correctly)



getMonth
public byte getMonth()(Code)
Get the month component of the date (in local form)



getStringValueCS
public CharSequence getStringValueCS()(Code)
Convert to string ISO 8601 representation.



getWeekNumber
final public static int getWeekNumber(int year, int month, int day)(Code)
Get the ISO week number for a given date. The days of the week are numbered from 1 (Monday) to 7 (Sunday), and week 1 in any calendar year is the week (from Monday to Sunday) that includes the first Thursday of that year



getWeekNumberWithinMonth
final public static int getWeekNumberWithinMonth(int year, int month, int day)(Code)
Get the week number within a month. This is required for the XSLT format-date() function, and the rules are not entirely clear. The days of the week are numbered from 1 (Monday) to 7 (Sunday), and by analogy with the ISO week number, we consider that week 1 in any calendar month is the week (from Monday to Sunday) that includes the first Thursday of that month. Unlike the ISO week number, we put the previous days in week zero.



getYear
public int getYear()(Code)
Get the year component of the date (in local form)



hashCode
public int hashCode()(Code)



isLeapYear
public static boolean isLeapYear(int year)(Code)
Test whether a year is a leap year



isValidDate
public static boolean isValidDate(int year, int month, int day)(Code)



main
public static void main(String[] args) throws Exception(Code)
Temporary test rig



setLexicalValue
public void setLexicalValue(CharSequence s) throws XPathException(Code)
Initialize the DateValue using a character string in the format yyyy-mm-dd and an optional time zone. Input must have format [+|-]yyyy-mm-dd[([+|-]hh:mm | Z)]
Parameters:
  s - the supplied string value
throws:
  net.sf.saxon.trans.XPathException -



subtract
public SecondsDurationValue subtract(CalendarValue other, XPathContext context) throws XPathException(Code)
Determine the difference between two points in time, as a duration
Parameters:
  other - the other point in time
Parameters:
  context - the duration as an xdt:dayTimeDuration
throws:
  net.sf.saxon.trans.XPathException - for example if one value is a date and the other is a time



toDateTime
public DateTimeValue toDateTime()(Code)
Convert to DateTime



tomorrow
public static DateValue tomorrow(int year, byte month, byte day)(Code)
Get the date that immediately follows a given date a new DateValue with no timezone information



yesterday
public static DateValue yesterday(int year, byte month, byte day)(Code)
Get the date that immediately precedes a given date a new DateValue with no timezone information



Fields inherited from net.sf.saxon.value.CalendarValue
final public static int NO_TIMEZONE(Code)(Java Doc)

Methods inherited from net.sf.saxon.value.CalendarValue
abstract public CalendarValue add(DurationValue duration) throws XPathException(Code)(Java Doc)
abstract public CalendarValue adjustTimezone(int tz)(Code)(Java Doc)
static void appendString(FastStringBuffer sb, int value, int size)(Code)(Java Doc)
final public void appendTimezone(FastStringBuffer sb)(Code)(Java Doc)
final public static void appendTimezone(int tz, FastStringBuffer sb)(Code)(Java Doc)
static void appendTwoDigits(FastStringBuffer sb, int value)(Code)(Java Doc)
abstract public int compareTo(CalendarValue other, XPathContext context)(Code)(Java Doc)
abstract public CalendarValue copy()(Code)(Java Doc)
abstract public GregorianCalendar getCalendar()(Code)(Java Doc)
final public String getStringValue()(Code)(Java Doc)
final public int getTimezoneInMinutes()(Code)(Java Doc)
final public boolean hasTimezone()(Code)(Java Doc)
final public CalendarValue removeTimezone()(Code)(Java Doc)
final public void setTimezoneInMinutes(int minutes)(Code)(Java Doc)
public SecondsDurationValue subtract(CalendarValue other, XPathContext context) throws XPathException(Code)(Java Doc)
abstract public DateTimeValue toDateTime()(Code)(Java Doc)

Methods inherited from net.sf.saxon.value.AtomicValue
public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code)(Java Doc)
final public AtomicValue convert(int requiredType, XPathContext context) throws XPathException(Code)(Java Doc)
public AtomicValue convert(AtomicType targetType, XPathContext context, boolean validate)(Code)(Java Doc)
abstract public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)(Code)(Java Doc)
final public void display(int level, NamePool pool, PrintStream out)(Code)(Java Doc)
public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)(Java Doc)
final public String evaluateAsString(XPathContext context)(Code)(Java Doc)
public Item evaluateItem(XPathContext context) throws XPathException(Code)(Java Doc)
final public int getCardinality()(Code)(Java Doc)
public AtomicValue getComponent(int component) throws XPathException(Code)(Java Doc)
public int getImplementationMethod()(Code)(Java Doc)
final public int getLength()(Code)(Java Doc)
public AtomicValue getPrimitiveValue()(Code)(Java Doc)
abstract public String getStringValue()(Code)(Java Doc)
public CharSequence getStringValueCS()(Code)(Java Doc)
final public SequenceIterator getTypedValue()(Code)(Java Doc)
public boolean hasBuiltInType()(Code)(Java Doc)
final public SequenceIterator iterate(XPathContext context)(Code)(Java Doc)
public void process(XPathContext context) throws XPathException(Code)(Java Doc)
public boolean schemaEquals(Value obj)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Fields inherited from net.sf.saxon.value.Value
final public static Class[] EMPTY_CLASS_ARRAY(Code)(Java Doc)

Methods inherited from net.sf.saxon.value.Value
public static Item asItem(ValueRepresentation value, XPathContext context) throws XPathException(Code)(Java Doc)
public static SequenceIterator asIterator(ValueRepresentation val, XPathContext context) throws XPathException(Code)(Java Doc)
public static Value asValue(ValueRepresentation val)(Code)(Java Doc)
public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code)(Java Doc)
public static CharSequence collapseWhitespace(CharSequence in)(Code)(Java Doc)
public static Object convert(Item item) throws XPathException(Code)(Java Doc)
public static Value convertJavaObjectToXPath(Object object, SequenceType requiredType, Configuration config) throws XPathException(Code)(Java Doc)
public Object convertToJava(Class target, XPathContext context) throws XPathException(Code)(Java Doc)
public void display(int level, NamePool pool, PrintStream out)(Code)(Java Doc)
public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public String evaluateAsString(XPathContext context) throws XPathException(Code)(Java Doc)
public Item evaluateItem(XPathContext context) throws XPathException(Code)(Java Doc)
public int getCardinality()(Code)(Java Doc)
final public int getDependencies()(Code)(Java Doc)
public ItemType getItemType(TypeHierarchy th)(Code)(Java Doc)
public static SequenceIterator getIterator(ValueRepresentation val) throws XPathException(Code)(Java Doc)
public int getLength() throws XPathException(Code)(Java Doc)
final public Container getParentExpression()(Code)(Java Doc)
public int getSpecialProperties()(Code)(Java Doc)
public String getStringValue() throws XPathException(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public Item itemAt(int n) throws XPathException(Code)(Java Doc)
final public Iterator iterateSubExpressions()(Code)(Java Doc)
public static QNameValue makeQNameValue(Object object, Configuration config)(Code)(Java Doc)
public static CharSequence normalizeWhitespace(CharSequence in)(Code)(Java Doc)
final public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)(Code)(Java Doc)
public void process(XPathContext context) throws XPathException(Code)(Java Doc)
final public Expression promote(PromotionOffer offer)(Code)(Java Doc)
public Value reduce() throws XPathException(Code)(Java Doc)
public boolean schemaEquals(Value obj)(Code)(Java Doc)
final public Expression simplify(StaticContext env)(Code)(Java Doc)
public static double stringToNumber(CharSequence s) throws NumberFormatException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public static CharSequence trimWhitespace(CharSequence in)(Code)(Java Doc)
final public Expression typeCheck(StaticContext env, ItemType contextItemType)(Code)(Java Doc)

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.