Package org.eclipse.wst.xml.xpath2.processor.internal.types


org.eclipse.wst.xml.xpath2.processor.internal.types
Class XSYearMonthDuration



public class XSYearMonthDuration
extends org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration
A representation of the YearMonthDuration datatype

Constructor Summary

XSYearMonthDuration(int year , int month , boolean negative)
XSYearMonthDuration(int months)
XSYearMonthDuration()

Method Summary

public org.eclipse.wst.xml.xpath2.api.ResultSequenceconstructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Creates a new ResultSequence consisting of the extractable time duration from the supplied ResultSequence
public org.eclipse.wst.xml.xpath2.api.ResultSequencediv(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical division between this duration stored and the supplied duration of time (of type XSYearMonthDuration)
public booleaneq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)
     Equality comparison between this and the supplied duration of time.
public java.lang.StringgetStringValue()
     Retrieves a String representation of the duration of time stored
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinitiongetTypeDefinition()
    
public booleangt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)
     Comparison between this and the supplied duration of time.
public booleanlt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)
     Comparison between this and the supplied duration of time.
public org.eclipse.wst.xml.xpath2.api.ResultSequenceminus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical subtraction between this duration stored and the supplied duration of time (of type XSYearMonthDuration)
public intmonthValue()
     Retrieves the duration of time stored as the number of months within it
public booleannegative()
     Retrieves whether this duration represents a backward passage through time
public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDurationparseYMDuration(java.lang.String str)
     Creates a new XSYearMonthDuration by parsing the supplied String represented duration of time
public org.eclipse.wst.xml.xpath2.api.ResultSequenceplus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical addition between this duration stored and the supplied duration of time (of type XSYearMonthDuration)
public java.lang.Stringstring_type()
     Retrieves the datatype's full pathname
public org.eclipse.wst.xml.xpath2.api.ResultSequencetimes(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical multiplication between this duration stored and the supplied duration of time (of type XSYearMonthDuration)
public java.lang.Stringtype_name()
     Retrives the datatype's name

Constructor Detail

XSYearMonthDuration

public XSYearMonthDuration(int year , int month , boolean negative)

Initialises using the supplied parameters. If the number of months supplied is more than 12, the number of years is adjusted accordingly.


XSYearMonthDuration

public XSYearMonthDuration(int months)

Initialises to the given number of months


XSYearMonthDuration

public XSYearMonthDuration()

Initialises to a duration of no time (0years and 0months)


Methods Detail

constructor

public org.eclipse.wst.xml.xpath2.api.ResultSequence constructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Creates a new ResultSequence consisting of the extractable time duration from the supplied ResultSequence

Parameters

arg - The ResultSequence from which to extract

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New ResultSequence consisting of the time duration extracted

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


div

public org.eclipse.wst.xml.xpath2.api.ResultSequence div(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical division between this duration stored and the supplied duration of time (of type XSYearMonthDuration)

Parameters

arg - The duration of time to divide by

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New XSYearMonthDuration representing the resulting duration after the division

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


eq

public boolean eq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)

Equality comparison between this and the supplied duration of time.

Parameters

arg - The duration of time to compare with

dynamicContext

Returns

boolean - True if they both represent the duration of time. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


getStringValue

public java.lang.String getStringValue()

Retrieves a String representation of the duration of time stored

Returns

java.lang.String - String representation of the duration of time stored


getTypeDefinition

public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition getTypeDefinition()

Returns

org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition


gt

public boolean gt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)

Comparison between this and the supplied duration of time.

Parameters

arg - The duration of time to compare with

context

Returns

boolean - True if the supplied time represents a smaller duration than that stored. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


lt

public boolean lt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)

Comparison between this and the supplied duration of time.

Parameters

arg - The duration of time to compare with

context

Returns

boolean - True if the supplied time represents a larger duration than that stored. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


minus

public org.eclipse.wst.xml.xpath2.api.ResultSequence minus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical subtraction between this duration stored and the supplied duration of time (of type XSYearMonthDuration)

Parameters

arg - The duration of time to subtract

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New XSYearMonthDuration representing the resulting duration after the subtraction

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


monthValue

public int monthValue()

Retrieves the duration of time stored as the number of months within it

Returns

int - Number of months making up this duration of time


negative

public boolean negative()

Retrieves whether this duration represents a backward passage through time

Returns

boolean - True if this duration represents a backward passage through time. False otherwise


parseYMDuration

public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration parseYMDuration(java.lang.String str)

Creates a new XSYearMonthDuration by parsing the supplied String represented duration of time

Parameters

str - String represented duration of time

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration - New XSYearMonthDuration representing the duration of time supplied


plus

public org.eclipse.wst.xml.xpath2.api.ResultSequence plus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical addition between this duration stored and the supplied duration of time (of type XSYearMonthDuration)

Parameters

arg - The duration of time to add

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New XSYearMonthDuration representing the resulting duration after the addition

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


string_type

public java.lang.String string_type()

Retrieves the datatype's full pathname

Returns

java.lang.String - "xs:yearMonthDuration" which is the datatype's full pathname


times

public org.eclipse.wst.xml.xpath2.api.ResultSequence times(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical multiplication between this duration stored and the supplied duration of time (of type XSYearMonthDuration)

Parameters

arg - The duration of time to multiply by

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New XSYearMonthDuration representing the resulting duration after the multiplication

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


type_name

public java.lang.String type_name()

Retrives the datatype's name

Returns

java.lang.String - "yearMonthDuration" which is the datatype's name