APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.dv.xs

public Class DurationDV

extends AbstractDateTimeDV
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xerces.internal.impl.dv.xs.YearMonthDurationDV, com.sun.org.apache.xerces.internal.impl.dv.xs.DayTimeDurationDV
Imports
java.math.BigDecimal, .BigInteger, javax.xml.datatype.DatatypeConstants, .Duration, com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException, .ValidationContext

Validator for <duration> datatype (W3C Schema Datatypes)
Authors
Elena Litani, Gopal Sharma, SUN Microsystem Inc.

Field Summary

Modifier and TypeField and Description
private static final AbstractDateTimeDV.DateTimeData[]
public static final int
public static final int
public static final int
Inherited from com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV:
datatypeFactoryDAYMONTHYEAR

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private AbstractDateTimeDV.DateTimeData
protected short

Returns:

INDETERMINATE if the order relationship between date1 and date2 is indeterminate. EQUAL if the order relation between date1 and date2 is EQUAL. If the strict parameter is true, return LESS_THAN if date1 is less than date2 and return GREATER_THAN if date1 is greater than date2. If the strict parameter is false, return LESS_THAN if date1 is less than OR equal to date2 and return GREATER_THAN if date1 is greater than OR equal to date2
compareDates
(AbstractDateTimeDV.DateTimeData
Unnormalized duration
date1
,
AbstractDateTimeDV.DateTimeData
Unnormalized duration
date2
,
boolean
(min/max)Exclusive strict == true ( LESS_THAN ) or ( GREATER_THAN ) (min/max)Inclusive strict == false (LESS_EQUAL) or (GREATER_EQUAL)
strict
)

Overrides com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV.compareDates.

Compares 2 given durations.

private short
compareResults(short resultA, short resultB, boolean strict)

protected String
public Object
protected Duration
protected AbstractDateTimeDV.DateTimeData

Returns:

normalized date representation
parse
(String
The lexical representation of duration object PnYn MnDTnH nMnS
str
,
int durationType)

Parses, validates and computes normalized version of duration object

protected double
Inherited from com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV:
appendappendappend2comparecompareOrderfindUTCSignfQuotientfQuotientgetAllowedFacetsgetDategetFractionalSecondsAsBigDecimalgetTimegetTimeZonegetXMLGregorianCalendargetYearMonthindexOfisIdenticalisNextCharUTCSignmaxDayInMonthFormodmodulonormalizeparseIntparseIntYearparseTimeZoneresetDateObjsaveUnnormalizedvalidateDateTime

Field Detail

DATETIMESback to summary
private static final AbstractDateTimeDV.DateTimeData[] DATETIMES
DAYTIMEDURATION_TYPEback to summary
public static final int DAYTIMEDURATION_TYPE
DURATION_TYPEback to summary
public static final int DURATION_TYPE
YEARMONTHDURATION_TYPEback to summary
public static final int YEARMONTHDURATION_TYPE

Constructor Detail

DurationDVback to summary
public DurationDV()

Method Detail

addDurationback to summary
private AbstractDateTimeDV.DateTimeData addDuration(AbstractDateTimeDV.DateTimeData date, AbstractDateTimeDV.DateTimeData addto, AbstractDateTimeDV.DateTimeData duration)
compareDatesback to summary
protected short compareDates(AbstractDateTimeDV.DateTimeData date1, AbstractDateTimeDV.DateTimeData date2, boolean strict)

Overrides com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV.compareDates.

Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration")

Parameters
date1:AbstractDateTimeDV.DateTimeData

Unnormalized duration

date2:AbstractDateTimeDV.DateTimeData

Unnormalized duration

strict:boolean

(min/max)Exclusive strict == true ( LESS_THAN ) or ( GREATER_THAN ) (min/max)Inclusive strict == false (LESS_EQUAL) or (GREATER_EQUAL)

Returns:short

INDETERMINATE if the order relationship between date1 and date2 is indeterminate. EQUAL if the order relation between date1 and date2 is EQUAL. If the strict parameter is true, return LESS_THAN if date1 is less than date2 and return GREATER_THAN if date1 is greater than date2. If the strict parameter is false, return LESS_THAN if date1 is less than OR equal to date2 and return GREATER_THAN if date1 is greater than OR equal to date2

compareResultsback to summary
private short compareResults(short resultA, short resultB, boolean strict)
dateToStringback to summary
protected String dateToString(AbstractDateTimeDV.DateTimeData date)

Overrides com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV.dateToString.

getActualValueback to summary
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException

Implements abstract com.sun.org.apache.xerces.internal.impl.dv.xs.TypeValidator.getActualValue.

getDurationback to summary
protected Duration getDuration(AbstractDateTimeDV.DateTimeData date)

Overrides com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV.getDuration.

parseback to summary
protected AbstractDateTimeDV.DateTimeData parse(String str, int durationType) throws SchemaDateTimeException

Parses, validates and computes normalized version of duration object

Parameters
str:String

The lexical representation of duration object PnYn MnDTnH nMnS

Returns:AbstractDateTimeDV.DateTimeData

normalized date representation

Exceptions
SchemaDateTimeException:
Invalid lexical representation
parseSecondback to summary
protected double parseSecond(String buffer, int start, int end) throws NumberFormatException

Overrides com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV.parseSecond.