org.semanticweb.HermiT.model.dataranges
Class DatatypeRestrictionDouble

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

public class DatatypeRestrictionDouble
extends DatatypeRestriction


Nested Class Summary
 class DatatypeRestrictionDouble.Interval
           
protected static class DatatypeRestrictionDouble.IntervalComparator
           
 
Nested classes/interfaces inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
DatatypeRestriction.DT, DatatypeRestriction.Facets
 
Field Summary
protected  java.util.Set<DatatypeRestrictionDouble.Interval> intervals
           
 
Fields inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
datatype, isBottom, isNegated, notOneOf, oneOf, supportedFacets, uris
 
Constructor Summary
DatatypeRestrictionDouble(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.
 boolean facetsAccept(DataConstant constant)
          Checks if the constant conforms to the facets
 java.math.BigInteger getEnumerationSize()
          Compute the set of String representations of the allowed values for this data range, provided it is finite.
 java.util.Set<DatatypeRestrictionDouble.Interval> getIntervals()
           
 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.
protected  boolean hasOnlyFiniteIntervals()
           
 boolean isFinite()
          Checks whether the interpretation of this data range is necessarily finite.
 boolean isNaN(long bits)
           
 double nextDouble(double value)
           
 double previousDouble(double value)
           
protected  java.lang.String printExtraInfo(Namespaces namespaces)
          Can be overwritten by the sub-classes, to print something between the datatype restriction and the list of oneOfs/notOneOfs
 
Methods inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
addOneOf, getArity, getDatatype, getDatatypeURI, getOneOf, isBottom, isNegated, negate, notOneOf, setNotOneOf, setOneOf, supports, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

intervals

protected java.util.Set<DatatypeRestrictionDouble.Interval> intervals
Constructor Detail

DatatypeRestrictionDouble

public DatatypeRestrictionDouble(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.

hasOnlyFiniteIntervals

protected boolean hasOnlyFiniteIntervals()

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.

nextDouble

public double nextDouble(double value)

previousDouble

public double previousDouble(double value)

isNaN

public boolean isNaN(long bits)

facetsAccept

public boolean facetsAccept(DataConstant constant)
Description copied from interface: CanonicalDataRange
Checks if the constant conforms to the facets

Specified by:
facetsAccept in interface CanonicalDataRange
Overrides:
facetsAccept in class DatatypeRestriction
Returns:
true if no facets are present or if facets accept constant and false otherwise

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.

getIntervals

public java.util.Set<DatatypeRestrictionDouble.Interval> getIntervals()

printExtraInfo

protected java.lang.String printExtraInfo(Namespaces namespaces)
Description copied from class: DatatypeRestriction
Can be overwritten by the sub-classes, to print something between the datatype restriction and the list of oneOfs/notOneOfs

Overrides:
printExtraInfo in class DatatypeRestriction
Returns:
a string with extra information for the toString method, e.g., about facet values

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