|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.clarkparsia.pellet.datatypes.types.text.RestrictedTextDatatype
public class RestrictedTextDatatype
Title: Restricted Text Datatype
Description: A subset of the value space of rdf:plainLiteral
Copyright: Copyright (c) 2009
Company: Clark & Parsia, LLC.
Constructor Summary | |
---|---|
RestrictedTextDatatype(Datatype<aterm.ATermAppl> dt,
boolean allowLang)
|
|
RestrictedTextDatatype(Datatype<aterm.ATermAppl> dt,
java.lang.String pattern)
|
Method Summary | |
---|---|
static boolean |
addPermittedDatatype(aterm.ATermAppl dt)
|
RestrictedDatatype<aterm.ATermAppl> |
applyConstrainingFacet(aterm.ATermAppl facet,
java.lang.Object value)
Apply a constraining facet to further restrict the value space |
boolean |
contains(java.lang.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(java.util.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. |
java.util.Iterator<aterm.ATermAppl> |
valueIterator()
Get a (possibly infinite) iterator over values in the data range. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestrictedTextDatatype(Datatype<aterm.ATermAppl> dt, boolean allowLang)
public RestrictedTextDatatype(Datatype<aterm.ATermAppl> dt, java.lang.String pattern)
Method Detail |
---|
public static boolean addPermittedDatatype(aterm.ATermAppl dt)
public RestrictedDatatype<aterm.ATermAppl> applyConstrainingFacet(aterm.ATermAppl facet, java.lang.Object value) throws InvalidConstrainingFacetException
RestrictedDatatype
applyConstrainingFacet
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)
InvalidConstrainingFacetException
public boolean contains(java.lang.Object value)
DataRange
contains
in interface DataRange<aterm.ATermAppl>
value
- the value to check
true
if the data range contains value
,
false
elsepublic boolean containsAtLeast(int n)
DataRange
containsAtLeast
in interface DataRange<aterm.ATermAppl>
n
- the number of elements
true
if the data range contains n
or
more elements, false
otherwisepublic RestrictedDatatype<aterm.ATermAppl> exclude(java.util.Collection<?> values)
RestrictedDatatype
values
that are not contained in the restriction are
ignored.
exclude
in interface RestrictedDatatype<aterm.ATermAppl>
values
- The values to exclude
RestrictedDatatype
public Datatype<? extends aterm.ATermAppl> getDatatype()
RestrictedDatatype
getDatatype
in interface RestrictedDatatype<aterm.ATermAppl>
public aterm.ATermAppl getValue(int i)
DataRange
LiteralValueBranch
shiftTryNext
getValue
in interface DataRange<aterm.ATermAppl>
i
- the index of the value in the data range
public RestrictedDatatype<aterm.ATermAppl> intersect(RestrictedDatatype<?> other, boolean negated)
RestrictedDatatype
getDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()
intersect
in interface RestrictedDatatype<aterm.ATermAppl>
other
- restricted datatype to merge into thisnegated
- true
if other
is negated,
false
else
RestrictedDatatype
, representing the intersection
of this
and other
public boolean isEmpty()
DataRange
!containsAtLeast(0)
isEmpty
in interface DataRange<aterm.ATermAppl>
true
if the data range contains no elements,
false
otherwisepublic boolean isEnumerable()
DataRange
isEnumerable
in interface DataRange<aterm.ATermAppl>
true
if the data range is enumerable,
false
otherwisepublic boolean isFinite()
DataRange
isFinite
in interface DataRange<aterm.ATermAppl>
true
if the data range is finite, false
otherwisepublic int size()
DataRange
LiteralValueBranch
constructor
size
in interface DataRange<aterm.ATermAppl>
public RestrictedDatatype<aterm.ATermAppl> union(RestrictedDatatype<?> other)
RestrictedDatatype
getDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()
union
in interface RestrictedDatatype<aterm.ATermAppl>
other
- restricted datatype to merge with this
RestrictedDatatype
, representing the intersection
of this
and other
public java.util.Iterator<aterm.ATermAppl> valueIterator()
DataRange
valueIterator
in interface DataRange<aterm.ATermAppl>
Iterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |