Java Doc for DurationValue.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.DurationValue

All known Subclasses:   net.sf.saxon.value.SecondsDurationValue,  net.sf.saxon.value.MonthDurationValue,
DurationValue
public class DurationValue extends AtomicValue (Code)
A value of type xs:duration


Field Summary
protected  intdays
    
protected  inthours
    
protected  intmicroseconds
    
protected  intminutes
    
protected  intmonths
    
protected  booleannegative
    
protected  intseconds
    
protected  intyears
    

Constructor Summary
protected  DurationValue()
    
public  DurationValue(boolean positive, int years, int months, int days, int hours, int minutes, int seconds, int microseconds)
    
public  DurationValue(CharSequence s)
    

Method Summary
public  DurationValueadd(DurationValue other, XPathContext context)
    
protected  voidbadDuration(String msg, CharSequence s)
    
public  AtomicValueconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
    
public  ObjectconvertToJava(Class target, XPathContext context)
    
public  DecimalValuedivide(DurationValue other, XPathContext context)
    
public  booleanequals(Object other)
     Test if the two durations are of equal length.
public  AtomicValuegetComponent(int component)
    
public  ItemTypegetItemType(TypeHierarchy th)
    
public  doublegetLengthInSeconds()
     Get length of duration in seconds, assuming an average length of month.
public  StringgetStringValue()
     Convert the value to a string, using the serialization rules. For atomic values this is the same as a cast; for sequence values it gives a space-separated list.
public  CharSequencegetStringValueCS()
    
public  inthashCode()
    
public  DurationValuemultiply(double factor, XPathContext context)
    
public  DurationValuenormalizeDuration()
     Normalize the duration, so that months<12, hours<24, minutes<60, seconds<60. At present we do this when converting to a string.
public  booleanschemaEquals(Value obj)
     Compare two values for equality.
public  DurationValuesubtract(DurationValue other, XPathContext context)
    

Field Detail
days
protected int days(Code)



hours
protected int hours(Code)



microseconds
protected int microseconds(Code)



minutes
protected int minutes(Code)



months
protected int months(Code)



negative
protected boolean negative(Code)



seconds
protected int seconds(Code)



years
protected int years(Code)




Constructor Detail
DurationValue
protected DurationValue()(Code)
Private constructor for internal use



DurationValue
public DurationValue(boolean positive, int years, int months, int days, int hours, int minutes, int seconds, int microseconds)(Code)



DurationValue
public DurationValue(CharSequence s) throws XPathException(Code)
Constructor: create a duration value from a supplied string, in ISO 8601 format [+|-]PnYnMnDTnHnMnS




Method Detail
add
public DurationValue add(DurationValue other, XPathContext context) throws XPathException(Code)
Add two durations



badDuration
protected void badDuration(String msg, CharSequence s) throws XPathException(Code)



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)



divide
public DecimalValue divide(DurationValue other, XPathContext context) throws XPathException(Code)
Divide a duration by a another duration



equals
public boolean equals(Object other)(Code)
Test if the two durations are of equal length. Note: this function is defined in XPath 2.0, but its semantics are currently unclear.



getComponent
public AtomicValue getComponent(int component) throws XPathException(Code)
Get a component of the value



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



getLengthInSeconds
public double getLengthInSeconds()(Code)
Get length of duration in seconds, assuming an average length of month. (Note, this defines a total ordering on durations which is different from the partial order defined in XML Schema; XPath 2.0 currently avoids defining an ordering at all. But the ordering here is consistent with the ordering of the two duration subtypes in XPath 2.0.)



getStringValue
public String getStringValue()(Code)
Convert the value to a string, using the serialization rules. For atomic values this is the same as a cast; for sequence values it gives a space-separated list. This method is refined for AtomicValues so that it never throws an Exception.



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



hashCode
public int hashCode()(Code)



multiply
public DurationValue multiply(double factor, XPathContext context) throws XPathException(Code)
Multiply a duration by a number



normalizeDuration
public DurationValue normalizeDuration()(Code)
Normalize the duration, so that months<12, hours<24, minutes<60, seconds<60. At present we do this when converting to a string. It's possible that it should be done immediately on constructing the duration (so that component extraction functions get the normalized value). We're awaiting clarification of the spec...



schemaEquals
public boolean schemaEquals(Value obj)(Code)
Compare two values for equality. This supports the matching rules in XML Schema, which say that two durations are equal only if all six components are equal (thus 12 months does not equal one year).



subtract
public DurationValue subtract(DurationValue other, XPathContext context) throws XPathException(Code)
Subtract two durations



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.