com.clarkparsia.pellet.datatypes
Class EmptyRestrictedDatatype<T>

java.lang.Object
  extended by com.clarkparsia.pellet.datatypes.EmptyDataRange<T>
      extended by com.clarkparsia.pellet.datatypes.EmptyRestrictedDatatype<T>
All Implemented Interfaces:
DataRange<T>, RestrictedDatatype<T>

public class EmptyRestrictedDatatype<T>
extends EmptyDataRange<T>
implements RestrictedDatatype<T>

Title: Empty Iterator

Description: Re-usable empty restricted datatype implementation. Cannot be static so that parameterization is handled correctly.

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Mike Smith

Constructor Summary
EmptyRestrictedDatatype(Datatype<? extends T> datatype)
           
 
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.
 void getConstrainingFacetValues(aterm.ATermAppl[] facets, java.lang.Object[] values)
           
 Datatype<? extends T> getDatatype()
          Query for the base datatype of a restricted datatype.
 boolean inFacetSpace(aterm.ATermAppl facet, java.lang.Object value)
           
 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 class com.clarkparsia.pellet.datatypes.EmptyDataRange
contains, containsAtLeast, getValue, isEmpty, isEnumerable, isFinite, size, valueIterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.clarkparsia.pellet.datatypes.DataRange
contains, containsAtLeast, getValue, isEmpty, isEnumerable, isFinite, size, valueIterator
 

Constructor Detail

EmptyRestrictedDatatype

public EmptyRestrictedDatatype(Datatype<? extends T> datatype)
Method Detail

applyConstrainingFacet

public RestrictedDatatype<T> applyConstrainingFacet(aterm.ATermAppl facet,
                                                    java.lang.Object value)
Description copied from interface: RestrictedDatatype
Apply a constraining facet to further restrict the value space

Specified by:
applyConstrainingFacet in interface RestrictedDatatype<T>
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

exclude

public RestrictedDatatype<T> 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 in values that are not contained in the restriction are ignored.

Specified by:
exclude in interface RestrictedDatatype<T>
Parameters:
values - The values to exclude
Returns:
A new RestrictedDatatype

getConstrainingFacetValues

public void getConstrainingFacetValues(aterm.ATermAppl[] facets,
                                       java.lang.Object[] values)

getDatatype

public Datatype<? extends T> 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 interface RestrictedDatatype<T>
Returns:
the base datatype

inFacetSpace

public boolean inFacetSpace(aterm.ATermAppl facet,
                            java.lang.Object value)

intersect

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

Specified by:
intersect in interface RestrictedDatatype<T>
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

union

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

Specified by:
union in interface RestrictedDatatype<T>
Parameters:
other - restricted datatype to merge with this
Returns:
a new RestrictedDatatype, representing the intersection of this and other


Copyright © 2004 Evren Sirin. All Rights Reserved.