Class ComplementClassImpl

All Implemented Interfaces:
FrontsNode, BooleanClassDescription, ComplementClass, OntClass, OntResource, RDFNode, Resource

public class ComplementClassImpl extends OntClassImpl implements ComplementClass

Implementation of a node representing a complement class description.

  • Field Details

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

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

    • 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:
      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:
      UnsupportedOperationException - since a complement expression takes only a single argument.
    • addOperands

      public void addOperands(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:
      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
    • operator

      public Property operator()

      Answer the property that is used to construct this boolean expression, for example Profile.UNION_OF().

      Specified by:
      operator in interface BooleanClassDescription
      Returns:
      Profile.COMPLEMENT_OF()