org.semanticweb.HermiT.model.dataranges
Class DatatypeRestrictionBoolean

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

public class DatatypeRestrictionBoolean
extends DatatypeRestriction


Nested Class Summary
 
Nested classes/interfaces inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
DatatypeRestriction.DT, DatatypeRestriction.Facets
 
Field Summary
static DataConstant FALSE
           
static DataConstant TRUE
           
 
Fields inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
datatype, isBottom, isNegated, notOneOf, oneOf, supportedFacets, uris
 
Constructor Summary
DatatypeRestrictionBoolean(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 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, isBottom, 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
 

Field Detail

TRUE

public static DataConstant TRUE

FALSE

public static DataConstant FALSE
Constructor Detail

DatatypeRestrictionBoolean

public DatatypeRestrictionBoolean(DatatypeRestriction.DT datatype)
Method Detail

getNewInstance

public CanonicalDataRange getNewInstance()
Returns:
an new instance of the concrete implementation on which the method is called

isFinite

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

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.

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.

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.

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.

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.

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.

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.

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.

Parameters:
datatypes - a set of datatypes
Returns:
true if the implementation can handle all the given datatypes and false otherwise