org.semanticweb.HermiT.model.dataranges
Class DatatypeRestrictionLiteral

java.lang.Object
  extended by org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
      extended by org.semanticweb.HermiT.model.dataranges.DatatypeRestrictionLiteral
All Implemented Interfaces:
CanonicalDataRange, DataRange, DLPredicate

public class DatatypeRestrictionLiteral
extends DatatypeRestriction
implements DLPredicate, DataRange


Nested Class Summary
 
Nested classes/interfaces inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
DatatypeRestriction.DT, DatatypeRestriction.Facets
 
Field Summary
 
Fields inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
datatype, isBottom, isNegated, notOneOf, oneOf, supportedFacets, uris
 
Constructor Summary
DatatypeRestrictionLiteral(DatatypeRestriction.DT datatype)
           
 
Method Summary
 boolean accepts(DataConstant constant)
          Checks whether constant is the String representation of a value in the data range, where the string has to be interpreted according to the datatype URI.
 void addFacet(DatatypeRestriction.Facets facet, java.lang.String value)
          Adds a facet, if it is supported by the implementation that implements the data range.
 boolean canHandleAll(java.util.Set<DatatypeRestriction.DT> datatypes)
          Can be used to check whether the implementation supports the given set of datatypes, e.g., the implementation for integers supports long, unsignedByte, etc.
 void conjoinFacetsFrom(DataRange range)
          Conjoins the facet restrictions from the given data range, provided it is of the same concrete implementation, i.e., we can conjoins the facets of an instance of DatatypeRestrictionString to another instance of DatatypeRestrictionString.
 boolean datatypeAccepts(DataConstant constant)
          Can be used to check whether a given constant is in principle in the range of this implementation.
 java.math.BigInteger getEnumerationSize()
          Compute the set of String representations of the allowed values for this data range, provided it is finite.
 CanonicalDataRange getNewInstance()
           
 DataConstant getSmallestAssignment()
          Computes the lexicographically smallest assignment given the restrictions.
 boolean hasMinCardinality(java.math.BigInteger n)
          Checks whether the interpretation of this data range consists of at least n values.
 boolean isBottom()
          Checks whether this data range cannot contain values
 boolean isFinite()
          Checks whether the interpretation of this data range is necessarily finite.
 
Methods inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
addOneOf, facetsAccept, getArity, getDatatype, getDatatypeURI, getOneOf, isNegated, negate, notOneOf, printExtraInfo, setNotOneOf, setOneOf, supports, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.semanticweb.HermiT.model.dataranges.DataRange
addOneOf, getDatatype, getDatatypeURI, getOneOf, isNegated, negate, supports
 

Constructor Detail

DatatypeRestrictionLiteral

public DatatypeRestrictionLiteral(DatatypeRestriction.DT datatype)
Method Detail

getNewInstance

public CanonicalDataRange getNewInstance()
Specified by:
getNewInstance in interface DataRange
Returns:
an new instance of the concrete implementation on which the method is called

isBottom

public boolean isBottom()
Description copied from interface: CanonicalDataRange
Checks whether this data range cannot contain values

Specified by:
isBottom in interface CanonicalDataRange
Specified by:
isBottom in interface DataRange
Overrides:
isBottom in class DatatypeRestriction
Returns:
true if the restrictions on this data range cause the interpretation of it to be empty and false otherwise.

isFinite

public boolean isFinite()
Description copied from interface: CanonicalDataRange
Checks whether the interpretation of this data range is necessarily finite.

Specified by:
isFinite in interface CanonicalDataRange
Returns:
true if this data range has only finite representations and false otherwise.

addFacet

public void addFacet(DatatypeRestriction.Facets facet,
                     java.lang.String value)
Description copied from interface: DataRange
Adds a facet, if it is supported by the implementation that implements the data range.

Specified by:
addFacet in interface DataRange
Parameters:
facet - A facet.
value - A String representation of the facet value.

conjoinFacetsFrom

public void conjoinFacetsFrom(DataRange range)
Description copied from interface: CanonicalDataRange
Conjoins the facet restrictions from the given data range, provided it is of the same concrete implementation, i.e., we can conjoins the facets of an instance of DatatypeRestrictionString to another instance of DatatypeRestrictionString.

Specified by:
conjoinFacetsFrom in interface CanonicalDataRange
Parameters:
range - a data range that is of the same concrete implementation as this.

accepts

public boolean accepts(DataConstant constant)
Description copied from interface: CanonicalDataRange
Checks whether constant is the String representation of a value in the data range, where the string has to be interpreted according to the datatype URI.

Specified by:
accepts in interface CanonicalDataRange
Parameters:
constant - A String representation of a constant for this data range.
Returns:
true if constant represents a value in the interpretation of this data range and false otherwise.

hasMinCardinality

public boolean hasMinCardinality(java.math.BigInteger n)
Description copied from interface: CanonicalDataRange
Checks whether the interpretation of this data range consists of at least n values.

Specified by:
hasMinCardinality in interface CanonicalDataRange
Returns:
true if the interpretation of this data range allows for at least n values and false otherwise.

getEnumerationSize

public java.math.BigInteger getEnumerationSize()
Description copied from interface: CanonicalDataRange
Compute the set of String representations of the allowed values for this data range, provided it is finite.

Specified by:
getEnumerationSize in interface CanonicalDataRange
Returns:
The set of all Strings that are a representation of a value in the interpretation according to the datatype URI of this DataRange and null if the interpretation of this data range is infinite.

getSmallestAssignment

public DataConstant getSmallestAssignment()
Description copied from interface: CanonicalDataRange
Computes the lexicographically smallest assignment given the restrictions.

Specified by:
getSmallestAssignment in interface CanonicalDataRange
Returns:
The lexicographically smallest assignment given the restrictions or null if none exists.

datatypeAccepts

public boolean datatypeAccepts(DataConstant constant)
Description copied from interface: CanonicalDataRange
Can be used to check whether a given constant is in principle in the range of this implementation. Whether it conforms to the facets is not checked.

Specified by:
datatypeAccepts in interface CanonicalDataRange
Parameters:
constant - a constant
Returns:
true if the constant has a datatype that in principle is ok for this datatype restriction and false otherwise

canHandleAll

public boolean canHandleAll(java.util.Set<DatatypeRestriction.DT> datatypes)
Description copied from interface: CanonicalDataRange
Can be used to check whether the implementation supports the given set of datatypes, e.g., the implementation for integers supports long, unsignedByte, etc.

Specified by:
canHandleAll in interface CanonicalDataRange
Parameters:
datatypes - a set of datatypes
Returns:
true if the implementation can handle all the given datatypes and false otherwise