Class EnumeratedClassImpl

    • Field Detail

      • factory

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

      • EnumeratedClassImpl

        public EnumeratedClassImpl​(Node n,
                                   EnhGraph g)

        Construct an enumerated class 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 Detail

      • setOneOf

        public void setOneOf​(RDFList en)

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

        Specified by:
        setOneOf in interface EnumeratedClass
        Parameters:
        en - A list of individuals that defines the class extension for this class
        Throws:
        ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
      • addOneOf

        public void addOneOf​(Resource res)

        Add an individual to the enumeration that defines the class extension of this class.

        Specified by:
        addOneOf in interface EnumeratedClass
        Parameters:
        res - An individual 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​(java.util.Iterator<? extends Resource> individuals)

        Add each individual from the given iteration to the enumeration that defines the class extension of this class.

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

        public RDFList getOneOf()

        Answer a list of individuals that defines the extension of this class.

        Specified by:
        getOneOf in interface EnumeratedClass
        Returns:
        A list of individuals that is the class extension
        Throws:
        ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
      • hasOneOf

        public boolean hasOneOf​(Resource res)

        Answer true if the given individual is one of the enumerated individuals in the class extension of this class.

        Specified by:
        hasOneOf in interface EnumeratedClass
        Parameters:
        res - An individual to test
        Returns:
        True if the given individual is in the class extension for this class.
        Throws:
        ProfileException - If the Profile.ONE_OF() property is not supported in the current language profile.
      • removeOneOf

        public void removeOneOf​(Resource res)

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

        Specified by:
        removeOneOf in interface EnumeratedClass
        Parameters:
        res - A resource that may be declared to be part of this enumeration, and which is no longer one of the enumeration values.