org.semanticweb.HermiT.model.dataranges
Class DatatypeRestrictionAnyURI

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

public class DatatypeRestrictionAnyURI
extends DatatypeRestriction


Nested Class Summary
 
Nested classes/interfaces inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
DatatypeRestriction.DT, DatatypeRestriction.Facets
 
Field Summary
protected  boolean facetsChanged
           
protected  java.math.BigInteger maxLength
           
protected  java.math.BigInteger minLength
           
protected  java.lang.String pattern
           
protected  dk.brics.automaton.Automaton patternMatcher
           
protected  boolean patternMatcherContainsAllFacets
           
 
Fields inherited from class org.semanticweb.HermiT.model.dataranges.DatatypeRestriction
datatype, isBottom, isNegated, notOneOf, oneOf, supportedFacets, uris
 
Constructor Summary
DatatypeRestrictionAnyURI(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.
protected  void compileAllFacetsIntoPattern()
           
 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.
 CanonicalDataRange getNewInstance()
           
 java.lang.String getPattern()
           
 dk.brics.automaton.Automaton getPatternMatcher()
           
 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.
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

minLength

protected java.math.BigInteger minLength

maxLength

protected java.math.BigInteger maxLength

pattern

protected java.lang.String pattern

patternMatcher

protected dk.brics.automaton.Automaton patternMatcher

patternMatcherContainsAllFacets

protected boolean patternMatcherContainsAllFacets

facetsChanged

protected boolean facetsChanged
Constructor Detail

DatatypeRestrictionAnyURI

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

compileAllFacetsIntoPattern

protected void compileAllFacetsIntoPattern()

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.

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.

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

getPatternMatcher

public dk.brics.automaton.Automaton getPatternMatcher()

getPattern

public java.lang.String getPattern()

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