Class AllDifferentImpl

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

public class AllDifferentImpl extends OntResourceImpl implements AllDifferent

Implementation of the abstraction of axioms that denote the single name assumption.

  • Field Details

    • factory

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

    • AllDifferentImpl

      public AllDifferentImpl(Node n, EnhGraph g)

      Construct an all different axiom represented by the given node in the given graph.

      Parameters:
      n - The node that represents the axiom
      g - The enhanced graph that contains n
  • Method Details

    • setDistinctMembers

      public void setDistinctMembers(RDFList members)

      Assert that the list of distinct individuals in this AllDifferent declaration is the given list. Any existing statements for distinctMembers will be removed.

      Specified by:
      setDistinctMembers in interface AllDifferent
      Parameters:
      members - A list of the members that are declared to be distinct.
      Throws:
      ProfileException - If the Profile.DISTINCT_MEMBERS() property is not supported in the current language profile.
    • addDistinctMember

      public void addDistinctMember(Resource res)

      Add the given individual to the list of distinct members of this AllDifferent declaration.

      Specified by:
      addDistinctMember in interface AllDifferent
      Parameters:
      res - A resource that will be added to the list of all different members.
      Throws:
      ProfileException - If the Profile.DISTINCT_MEMBERS() property is not supported in the current language profile.
    • addDistinctMembers

      public void addDistinctMembers(Iterator<? extends Resource> individuals)

      Add the given individuals to the list of distinct members of this AllDifferent declaration.

      Specified by:
      addDistinctMembers in interface AllDifferent
      Parameters:
      individuals - An iterator over the distinct invididuals that will be added
      Throws:
      ProfileException - If the Profile.DISTINCT_MEMBERS() property is not supported in the current language profile.
    • getDistinctMembers

      public RDFList getDistinctMembers()

      Answer the list of distinct members for this AllDifferent declaration.

      Specified by:
      getDistinctMembers in interface AllDifferent
      Returns:
      The list of individuals declared distinct by this AllDifferent declaration.
      Throws:
      ProfileException - If the Profile.DISTINCT_MEMBERS() property is not supported in the current language profile.
    • listDistinctMembers

      public ExtendedIterator<? extends OntResource> listDistinctMembers()

      Answer an iterator over all of the individuals that are declared to be distinct by this AllDifferent declaration. Each element of the iterator will be an OntResource.

      Specified by:
      listDistinctMembers in interface AllDifferent
      Returns:
      An iterator over distinct individuals.
      Throws:
      ProfileException - If the Profile.DISTINCT_MEMBERS() property is not supported in the current language profile.
    • hasDistinctMember

      public boolean hasDistinctMember(Resource res)

      Answer true if this AllDifferent declaration includes res as one of the distinct individuals.

      Specified by:
      hasDistinctMember in interface AllDifferent
      Parameters:
      res - A resource to test against
      Returns:
      True if res is declared to be distinct from the other individuals in this declaration.
      Throws:
      ProfileException - If the Profile.DISTINCT_MEMBERS() property is not supported in the current language profile.
    • removeDistinctMember

      public void removeDistinctMember(Resource res)

      Remove the given resource from the list of distinct individuals. If this statement is not true of the current model, nothing happens.

      Specified by:
      removeDistinctMember in interface AllDifferent
      Parameters:
      res - A resource that is no longer distinct from the other listed individuals