public class RestrictedTextDatatype extends Object implements RestrictedDatatype<aterm.ATermAppl>
Title: Restricted Text Datatype
Description: A subset of the value space of rdf:plainLiteral
Copyright: Copyright (c) 2009
Company: Clark & Parsia, LLC.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
LANGUAGE |
protected static String |
NAME |
protected static String |
NCNAME |
protected static String |
NMTOKEN |
protected static String |
NORMALIZED_STRING |
protected static String |
TOKEN |
| Constructor and Description |
|---|
RestrictedTextDatatype(Datatype<aterm.ATermAppl> dt,
boolean allowLang) |
RestrictedTextDatatype(Datatype<aterm.ATermAppl> dt,
String pattern) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addPermittedDatatype(aterm.ATermAppl dt) |
RestrictedDatatype<aterm.ATermAppl> |
applyConstrainingFacet(aterm.ATermAppl facet,
Object value)
Apply a constraining facet to further restrict the value space
|
protected <T> List<T> |
concatLists(List<T> l1,
List<T> l2) |
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
|
RestrictedDatatype<aterm.ATermAppl> |
exclude(Collection<?> values)
Exclude specific elements from the data range.
|
Datatype<? extends aterm.ATermAppl> |
getDatatype()
Query for the base datatype of a restricted datatype.
|
aterm.ATermAppl |
getValue(int i)
Return a value from an enumerable data range.
|
RestrictedDatatype<aterm.ATermAppl> |
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.
|
int |
size()
Return the size of the data range.
|
RestrictedDatatype<aterm.ATermAppl> |
union(RestrictedDatatype<?> other)
Union this range with another range.
|
Iterator<aterm.ATermAppl> |
valueIterator()
Get a (possibly infinite) iterator over values in the data range.
|
protected static final String NCNAME
protected static final String NAME
protected static final String NMTOKEN
protected static final String TOKEN
protected static final String LANGUAGE
protected static final String NORMALIZED_STRING
public RestrictedTextDatatype(Datatype<aterm.ATermAppl> dt, boolean allowLang)
public static boolean addPermittedDatatype(aterm.ATermAppl dt)
public RestrictedDatatype<aterm.ATermAppl> applyConstrainingFacet(aterm.ATermAppl facet, Object value) throws InvalidConstrainingFacetException
RestrictedDatatypeapplyConstrainingFacet in interface RestrictedDatatype<aterm.ATermAppl>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)
DataRangepublic boolean containsAtLeast(int n)
DataRangecontainsAtLeast in interface DataRange<aterm.ATermAppl>n - the number of elementstrue if the data range contains n or
more elements, false otherwisepublic RestrictedDatatype<aterm.ATermAppl> exclude(Collection<?> values)
RestrictedDatatypevalues that are not contained in the restriction are
ignored.exclude in interface RestrictedDatatype<aterm.ATermAppl>values - The values to excludeRestrictedDatatypepublic Datatype<? extends aterm.ATermAppl> getDatatype()
RestrictedDatatypegetDatatype in interface RestrictedDatatype<aterm.ATermAppl>public aterm.ATermAppl getValue(int i)
DataRangeLiteralValueBranch shiftTryNextpublic RestrictedDatatype<aterm.ATermAppl> intersect(RestrictedDatatype<?> other, boolean negated)
RestrictedDatatypegetDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()intersect in interface RestrictedDatatype<aterm.ATermAppl>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)public boolean isEnumerable()
DataRangeisEnumerable in interface DataRange<aterm.ATermAppl>true if the data range is enumerable,
false otherwisepublic boolean isFinite()
DataRangepublic int size()
DataRangeLiteralValueBranch constructorpublic RestrictedDatatype<aterm.ATermAppl> union(RestrictedDatatype<?> other)
RestrictedDatatypegetDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()union in interface RestrictedDatatype<aterm.ATermAppl>other - restricted datatype to merge with thisRestrictedDatatype, representing the intersection
of this and otherpublic Iterator<aterm.ATermAppl> valueIterator()
DataRangevalueIterator in interface DataRange<aterm.ATermAppl>IteratorCopyright © 2019. All rights reserved.