com.clarkparsia.pellet.datatypes
Interface RestrictedDatatype<T>

All Superinterfaces:
DataRange<T>
All Known Implementing Classes:
EmptyRestrictedDatatype, RestrictedBooleanDatatype, RestrictedDurationDatatype, RestrictedFloatingPointDatatype, RestrictedFloatingPointDatatype, RestrictedRealDatatype, RestrictedRealDatatype, RestrictedTextDatatype, RestrictedTimelineDatatype, RestrictedURIDatatype

public interface RestrictedDatatype<T>
extends DataRange<T>

Title: Restricted Datatype

Description: Interface representing the value space of a datatype, optionally constrained by application of constraing facets (see applyConstrainingFacet(ATermAppl, Object)), and optionally excluding specific values (see exclude(Collection)).Implementations should be immutable, with all mutators returning either the object unchanged, or a new object.

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Mike Smith

Method Summary
 RestrictedDatatype<T> applyConstrainingFacet(aterm.ATermAppl facet, java.lang.Object value)
          Apply a constraining facet to further restrict the value space
 RestrictedDatatype<T> exclude(java.util.Collection<?> values)
          Exclude specific elements from the data range.
 Datatype<? extends T> getDatatype()
          Query for the base datatype of a restricted datatype.
 RestrictedDatatype<T> intersect(RestrictedDatatype<?> other, boolean negated)
          Intersect this range with another range.
 RestrictedDatatype<T> union(RestrictedDatatype<?> other)
          Union this range with another range.
 
Methods inherited from interface com.clarkparsia.pellet.datatypes.DataRange
contains, containsAtLeast, getValue, isEmpty, isEnumerable, isFinite, size, valueIterator
 

Method Detail

getDatatype

Datatype<? extends T> getDatatype()
Query for the base datatype of a restricted datatype. This is not necessarily a primitive datatype.

Returns:
the base datatype

applyConstrainingFacet

RestrictedDatatype<T> applyConstrainingFacet(aterm.ATermAppl facet,
                                             java.lang.Object value)
                                             throws InvalidConstrainingFacetException
Apply a constraining facet to further restrict the value space

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

intersect

RestrictedDatatype<T> intersect(RestrictedDatatype<?> other,
                                boolean negated)
Intersect this range with another range. It must be the case that getDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()

Parameters:
other - restricted datatype to merge into this
negated - true if other is negated, false else
Returns:
a new RestrictedDatatype, representing the intersection of this and other
Throws:
{@link - IllegalArgumentException} if the primitive datatypes for the ranges are not equal

exclude

RestrictedDatatype<T> exclude(java.util.Collection<?> values)
Exclude specific elements from the data range. Used when a restricted data range is in a conjunction with a negative enumeration. Elements in values that are not contained in the restriction are ignored.

Parameters:
values - The values to exclude
Returns:
A new RestrictedDatatype

union

RestrictedDatatype<T> union(RestrictedDatatype<?> other)
Union this range with another range. It must be the case that getDatatype().getPrimitiveDatatype().equals( other.getDatatype.getPrimiveDatatype()

Parameters:
other - restricted datatype to merge with this
Returns:
a new RestrictedDatatype, representing the intersection of this and other
Throws:
{@link - IllegalArgumentException} if the primitive datatypes for the ranges are not equal


Copyright © 2004 Evren Sirin. All Rights Reserved.