Class RestrictedTimelineDatatype
- java.lang.Object
-
- openllet.core.datatypes.types.datetime.RestrictedTimelineDatatype
-
- All Implemented Interfaces:
DataRange<javax.xml.datatype.XMLGregorianCalendar>
,RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
public class RestrictedTimelineDatatype extends java.lang.Object implements RestrictedDatatype<javax.xml.datatype.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.
- Author:
- Mike Smith
-
-
Field Summary
-
Fields inherited from interface openllet.core.datatypes.RestrictedDatatype
UNSUPPORTED_FORMAT, UNSUPPORTED_VALUE
-
-
Constructor Summary
Constructors Constructor Description RestrictedTimelineDatatype(Datatype<? extends javax.xml.datatype.XMLGregorianCalendar> datatype, javax.xml.namespace.QName schemaType, boolean requireTz)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
applyConstrainingFacet(openllet.aterm.ATermAppl facet, java.lang.Object value)
Apply a constraining facet to further restrict the value spaceboolean
contains(java.lang.Object value)
Check if a data range contains a particular valueboolean
containsAtLeast(int n)
Check that a data range contains a minimum number of elementsRestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
exclude(java.util.Collection<?> values)
Exclude specific elements from the _data range.Datatype<? extends javax.xml.datatype.XMLGregorianCalendar>
getDatatype()
Query for the base datatype of a restricted datatype.static javax.xml.datatype.DatatypeFactory
getDatatypeFactory()
RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
intersect(RestrictedDatatype<?> other, boolean negated)
Intersect this range with another range.boolean
isEmpty()
Convenience method equivalent to!
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.int
size()
Deprecated.java.lang.String
toString()
RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
union(RestrictedDatatype<?> other)
Union this range with another range.java.util.Iterator<javax.xml.datatype.XMLGregorianCalendar>
valueIterator()
Get a (possibly infinite) iterator over values in the _data range.
-
-
-
Constructor Detail
-
RestrictedTimelineDatatype
public RestrictedTimelineDatatype(Datatype<? extends javax.xml.datatype.XMLGregorianCalendar> datatype, javax.xml.namespace.QName schemaType, boolean requireTz)
-
-
Method Detail
-
getDatatypeFactory
public static javax.xml.datatype.DatatypeFactory getDatatypeFactory()
-
applyConstrainingFacet
public RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar> applyConstrainingFacet(openllet.aterm.ATermAppl facet, java.lang.Object value) throws InvalidConstrainingFacetException
Description copied from interface:RestrictedDatatype
Apply a constraining facet to further restrict the value space- Specified by:
applyConstrainingFacet
in interfaceRestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
- Parameters:
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)- Returns:
- the further restricted value space
- Throws:
InvalidConstrainingFacetException
-
contains
public boolean contains(java.lang.Object value)
Description copied from interface:DataRange
Check if a data range contains a particular value
-
containsAtLeast
public boolean containsAtLeast(int n)
Description copied from interface:DataRange
Check that a data range contains a minimum number of elements- Specified by:
containsAtLeast
in interfaceDataRange<javax.xml.datatype.XMLGregorianCalendar>
- Parameters:
n
- the number of elements- Returns:
true
if the _data range containsn
or more elements,false
otherwise
-
exclude
public RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar> exclude(java.util.Collection<?> values)
Description copied from interface:RestrictedDatatype
Exclude specific elements from the _data range. Used when a restricted _data range is in a conjunction with a negative enumeration. Elements invalues
that are not contained in the restriction are ignored.- Specified by:
exclude
in interfaceRestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
- Parameters:
values
- The values to exclude- Returns:
- A new
RestrictedDatatype
-
getDatatype
public Datatype<? extends javax.xml.datatype.XMLGregorianCalendar> getDatatype()
Description copied from interface:RestrictedDatatype
Query for the base datatype of a restricted datatype. This is not necessarily a primitive datatype.- Specified by:
getDatatype
in interfaceRestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
- Returns:
- the base datatype
-
intersect
public RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar> intersect(RestrictedDatatype<?> other, boolean negated)
Description copied from interface:RestrictedDatatype
Intersect this range with another range. It must be the case thatgetDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()
- Specified by:
intersect
in interfaceRestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
- Parameters:
other
- restricted datatype to merge into thisnegated
-true
ifother
is negated,false
else- Returns:
- a new
RestrictedDatatype
, representing the intersection ofthis
andother
-
isEmpty
public boolean isEmpty()
Description copied from interface:DataRange
Convenience method equivalent to!containsAtLeast(0)
-
isEnumerable
public boolean isEnumerable()
Description copied from interface:DataRange
Query if values in the _data range can be enumerated.- Specified by:
isEnumerable
in interfaceDataRange<javax.xml.datatype.XMLGregorianCalendar>
- Returns:
true
if the _data range is enumerable,false
otherwise
-
isFinite
public boolean isFinite()
Description copied from interface:DataRange
Query if there are a finite number of values in the _data range.
-
size
@Deprecated public int size()
Deprecated.Description copied from interface:DataRange
Return the size of the _data range. Necessary to support LiteralValueBranch constructor
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
union
public RestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar> union(RestrictedDatatype<?> other)
Description copied from interface:RestrictedDatatype
Union this range with another range. It must be the case thatgetDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()
- Specified by:
union
in interfaceRestrictedDatatype<javax.xml.datatype.XMLGregorianCalendar>
- Parameters:
other
- restricted datatype to merge with this- Returns:
- a new
RestrictedDatatype
, representing the intersection ofthis
andother
-
valueIterator
public java.util.Iterator<javax.xml.datatype.XMLGregorianCalendar> valueIterator()
Description copied from interface:DataRange
Get a (possibly infinite) iterator over values in the _data range.- Specified by:
valueIterator
in interfaceDataRange<javax.xml.datatype.XMLGregorianCalendar>
- Returns:
- an
Iterator
-
-