Class AllDifferentImpl

    • Field Detail

      • 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 Detail

      • 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 Detail

      • 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​(java.util.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.
      • 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