Class ComplementClassImpl

    • Field Detail

      • factory

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

      • ComplementClassImpl

        public ComplementClassImpl​(Node n,
                                   EnhGraph g)

        Construct a complement 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

      • setOperands

        public void setOperands​(RDFList operands)

        Assert that the operands for this boolean class expression are the classes in the given list. Any existing statements for the operator will be removed.

        Specified by:
        setOperands in interface BooleanClassDescription
        Parameters:
        operands - The list of operands to this expression.
        Throws:
        java.lang.UnsupportedOperationException - since a complement expression takes only a single argument.
      • setOperand

        public void setOperand​(Resource cls)

        Set the class that the class represented by this class expression is a complement of. Any existing value for complementOf will be replaced.

        Specified by:
        setOperand in interface ComplementClass
        Parameters:
        cls - The class that this class is a complement of.
      • addOperand

        public void addOperand​(Resource cls)

        Add a class the operands of this boolean expression.

        Specified by:
        addOperand in interface BooleanClassDescription
        Parameters:
        cls - A class that will be added to the operands of this Boolean expression
        Throws:
        java.lang.UnsupportedOperationException - since a complement expression takes only a single argument.
      • addOperands

        public void addOperands​(java.util.Iterator<? extends Resource> classes)

        Add all of the classes from the given iterator to the operands of this boolean expression.

        Specified by:
        addOperands in interface BooleanClassDescription
        Parameters:
        classes - A iterator over classes that will be added to the operands of this Boolean expression
        Throws:
        java.lang.UnsupportedOperationException - since a complement expression takes only a single argument.
      • getOperands

        public RDFList getOperands()

        Answer the list of operands for this Boolean class expression.

        Specified by:
        getOperands in interface BooleanClassDescription
        Returns:
        A list of the operands of this expression.
        Throws:
        ProfileException - If the operand property is not supported in the current language profile.
      • listOperands

        public ExtendedIterator<? extends OntClass> listOperands()

        Answer an iterator over all of the classes that are the operands of this Boolean class expression. Each element of the iterator will be an OntClass.

        Specified by:
        listOperands in interface BooleanClassDescription
        Returns:
        An iterator over the operands of the expression.
        Throws:
        ProfileException - If the operand property is not supported in the current language profile.
      • hasOperand

        public boolean hasOperand​(Resource cls)

        Answer true if this Boolean class expression has the given class as an operand.

        Specified by:
        hasOperand in interface BooleanClassDescription
        Parameters:
        cls - A class to test
        Returns:
        True if the given class is an operand to this expression.
        Throws:
        ProfileException - If the operand property is not supported in the current language profile.
      • getOperand

        public OntClass getOperand()

        Answer the class that the class described by this class description is a complement of.

        Specified by:
        getOperand in interface ComplementClass
        Returns:
        The class that this class is a complement of.
      • removeOperand

        public void removeOperand​(Resource res)

        Remove the given resource from the operands of this class expression.

        Specified by:
        removeOperand in interface BooleanClassDescription
        Parameters:
        res - An resource to be removed from the operands of this class expression