public class RestrictedTimelineDatatype extends Object implements RestrictedDatatype<XMLGregorianCalendar>
Title: Restricted time line datatype
Description: A base implementation for datatypes based on the XSD 7 property date time model. Calendar objects are converted to real numbers based on the XML 1.1 datatype spec. This implementation uses two real number interval collections (one with time zone present, one with time zone absent).
Copyright: Copyright (c) 2009
Company: Clark & Parsia, LLC.
| Modifier and Type | Field and Description |
|---|---|
protected Datatype<? extends XMLGregorianCalendar> |
datatype |
protected RestrictedDatatype<XMLGregorianCalendar> |
empty |
protected boolean |
enumerable |
protected boolean |
finite |
protected List<ContinuousRealInterval> |
nzIntervals |
protected QName |
schemaType |
protected List<ContinuousRealInterval> |
wzIntervals |
| Constructor and Description |
|---|
RestrictedTimelineDatatype(Datatype<? extends XMLGregorianCalendar> datatype,
QName schemaType,
boolean requireTz) |
| Modifier and Type | Method and Description |
|---|---|
RestrictedDatatype<XMLGregorianCalendar> |
applyConstrainingFacet(aterm.ATermAppl facet,
Object value)
Apply a constraining facet to further restrict the value space
|
boolean |
contains(Object value)
Check if a data range contains a particular value
|
boolean |
containsAtLeast(int n)
Check that a data range contains a minimum number of elements
|
protected RestrictedTimelineDatatype |
create(RestrictedTimelineDatatype other,
List<ContinuousRealInterval> wzIntervals,
List<ContinuousRealInterval> nzIntervals) |
RestrictedDatatype<XMLGregorianCalendar> |
exclude(Collection<?> values)
Exclude specific elements from the data range.
|
Datatype<? extends XMLGregorianCalendar> |
getDatatype()
Query for the base datatype of a restricted datatype.
|
static DatatypeFactory |
getDatatypeFactory() |
XMLGregorianCalendar |
getValue(int i)
Return a value from an enumerable data range.
|
RestrictedDatatype<XMLGregorianCalendar> |
intersect(RestrictedDatatype<?> other,
boolean negated)
Intersect this range with another range.
|
boolean |
isEmpty()
Convenience method equivalent to
!containsAtLeast(0) |
boolean |
isEnumerable()
Query if values in the data range can be enumerated.
|
boolean |
isFinite()
Query if there are a finite number of values in the data range.
|
protected boolean |
isValidValue(XMLGregorianCalendar c) |
int |
size()
Return the size of the data range.
|
String |
toString() |
RestrictedDatatype<XMLGregorianCalendar> |
union(RestrictedDatatype<?> other)
Union this range with another range.
|
Iterator<XMLGregorianCalendar> |
valueIterator()
Get a (possibly infinite) iterator over values in the data range.
|
protected final Datatype<? extends XMLGregorianCalendar> datatype
protected final RestrictedDatatype<XMLGregorianCalendar> empty
protected final boolean enumerable
protected final boolean finite
protected final List<ContinuousRealInterval> nzIntervals
protected final QName schemaType
protected final List<ContinuousRealInterval> wzIntervals
public RestrictedTimelineDatatype(Datatype<? extends XMLGregorianCalendar> datatype, QName schemaType, boolean requireTz)
public static DatatypeFactory getDatatypeFactory()
public RestrictedDatatype<XMLGregorianCalendar> applyConstrainingFacet(aterm.ATermAppl facet, Object value) throws InvalidConstrainingFacetException
RestrictedDatatypeapplyConstrainingFacet in interface RestrictedDatatype<XMLGregorianCalendar>facet - the constraining facet name (typically a URI)value - the value for the constraining facet. This is not necessarily
in the value space of the base datatype (e.g., length facet
values on string types are not)InvalidConstrainingFacetExceptionpublic boolean contains(Object value)
DataRangecontains in interface DataRange<XMLGregorianCalendar>value - the value to checktrue if the data range contains value,
false elsepublic boolean containsAtLeast(int n)
DataRangecontainsAtLeast in interface DataRange<XMLGregorianCalendar>n - the number of elementstrue if the data range contains n or
more elements, false otherwiseprotected RestrictedTimelineDatatype create(RestrictedTimelineDatatype other, List<ContinuousRealInterval> wzIntervals, List<ContinuousRealInterval> nzIntervals)
public RestrictedDatatype<XMLGregorianCalendar> exclude(Collection<?> values)
RestrictedDatatypevalues that are not contained in the restriction are
ignored.exclude in interface RestrictedDatatype<XMLGregorianCalendar>values - The values to excludeRestrictedDatatypepublic Datatype<? extends XMLGregorianCalendar> getDatatype()
RestrictedDatatypegetDatatype in interface RestrictedDatatype<XMLGregorianCalendar>public XMLGregorianCalendar getValue(int i)
DataRangeLiteralValueBranch shiftTryNextgetValue in interface DataRange<XMLGregorianCalendar>i - the index of the value in the data rangepublic RestrictedDatatype<XMLGregorianCalendar> intersect(RestrictedDatatype<?> other, boolean negated)
RestrictedDatatypegetDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()intersect in interface RestrictedDatatype<XMLGregorianCalendar>other - restricted datatype to merge into thisnegated - true if other is negated,
false elseRestrictedDatatype, representing the intersection
of this and otherpublic boolean isEmpty()
DataRange!containsAtLeast(0)isEmpty in interface DataRange<XMLGregorianCalendar>true if the data range contains no elements,
false otherwisepublic boolean isEnumerable()
DataRangeisEnumerable in interface DataRange<XMLGregorianCalendar>true if the data range is enumerable,
false otherwisepublic boolean isFinite()
DataRangeisFinite in interface DataRange<XMLGregorianCalendar>true if the data range is finite, false
otherwiseprotected boolean isValidValue(XMLGregorianCalendar c)
public int size()
DataRangeLiteralValueBranch constructorsize in interface DataRange<XMLGregorianCalendar>public RestrictedDatatype<XMLGregorianCalendar> union(RestrictedDatatype<?> other)
RestrictedDatatypegetDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()union in interface RestrictedDatatype<XMLGregorianCalendar>other - restricted datatype to merge with thisRestrictedDatatype, representing the intersection
of this and otherpublic Iterator<XMLGregorianCalendar> valueIterator()
DataRangevalueIterator in interface DataRange<XMLGregorianCalendar>IteratorCopyright © 2019. All rights reserved.