Class DataRangeImpl

All Implemented Interfaces:
FrontsNode, DataRange, OntResource, RDFNode, Resource

public class DataRangeImpl extends OntResourceImpl implements DataRange

Default implementation of the interface that defines a closed enumeration of concrete values for the range of a property.

  • Field Details

    • factory

      public static Implementation factory
      A factory for generating DataRange facets from nodes in enhanced graphs. Note: should not be invoked directly by user code: use as() instead.
  • Constructor Details

    • DataRangeImpl

      public DataRangeImpl(Node n, EnhGraph g)

      Construct a data range node represented by the given node in the given graph.

      Parameters:
      n - The node that represents the resource
      g - The enh graph that contains n
  • Method Details

    • setOneOf

      public void setOneOf(RDFList en)

      Assert that this data range is exactly the enumeration of the given individuals. Any existing statements for oneOf will be removed.

      Specified by:
      setOneOf in interface DataRange
      Parameters:
      en - A list of literals that defines the permissible values for this datarange
      Throws:
      ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
    • addOneOf

      public void addOneOf(Literal lit)

      Add a literal to the enumeration that defines the permissible values of this class.

      Specified by:
      addOneOf in interface DataRange
      Parameters:
      lit - A literal to add to the enumeration
      Throws:
      ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
    • addOneOf

      public void addOneOf(Iterator<Literal> literals)

      Add each literal from the given iteration to the enumeration that defines the permissible values of this datarange.

      Specified by:
      addOneOf in interface DataRange
      Parameters:
      literals - An iterator over literals
      Throws:
      ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
    • getOneOf

      public RDFList getOneOf()

      Answer a list of literals that defines the extension of this datarange.

      Specified by:
      getOneOf in interface DataRange
      Returns:
      A list of literals that is the permissible values
      Throws:
      ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
    • listOneOf

      public ExtendedIterator<Literal> listOneOf()

      Answer an iterator over all of the literals that are declared to be the permissible values for this class. Each element of the iterator will be an Literal.

      Specified by:
      listOneOf in interface DataRange
      Returns:
      An iterator over the literals that are the permissible values
      Throws:
      ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
    • hasOneOf

      public boolean hasOneOf(Literal lit)

      Answer true if the given literal is one of the enumerated literals that are the permissible values of this datarange.

      Specified by:
      hasOneOf in interface DataRange
      Parameters:
      lit - A literal to test
      Returns:
      True if the given literal is in the permissible values for this class.
      Throws:
      ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
    • removeOneOf

      public void removeOneOf(Literal lit)

      Remove the statement that this enumeration includes lit among its members. If this statement is not true of the current model, nothing happens.

      Specified by:
      removeOneOf in interface DataRange
      Parameters:
      lit - A literal that may be declared to be part of this data range, and which is no longer to be one of the data range values.