Class DefaultNode<E extends OWLObject>

java.lang.Object
org.semanticweb.owlapi.reasoner.impl.DefaultNode<E>
Type Parameters:
E - the type of entities in the node
All Implemented Interfaces:
Iterable<E>, Node<E>
Direct Known Subclasses:
OWLClassNode, OWLDataPropertyNode, OWLDatatypeNode, OWLNamedIndividualNode, OWLObjectPropertyNode

public abstract class DefaultNode<E extends OWLObject> extends Object implements Node<E>
Since:
3.0.0
Author:
Matthew Horridge, The University of Manchester, Information Management Group
  • Constructor Details

    • DefaultNode

      public DefaultNode(E entity)
      Parameters:
      entity - the entity to add
    • DefaultNode

      public DefaultNode(Collection<E> entities)
      Parameters:
      entities - the entities to add
    • DefaultNode

      public DefaultNode(Stream<E> entities)
      Parameters:
      entities - the entities to add
  • Method Details

    • add

      public void add(E entity)
      Parameters:
      entity - entity to be added
    • isTopNode

      public boolean isTopNode()
      Description copied from interface: Node
      Determines if this node represents the top node (in a hierarchy). For a named class node, the top node is the node that contains owl:Thing. For an object property node, the top node is the node that contains owl:topObjectProperty. For a data property node, the top node is the node that contains owl:topDataProperty
      Specified by:
      isTopNode in interface Node<E extends OWLObject>
      Returns:
      true if this node is an OWLClass node and it contains owl:Thing.
      true if this node is an OWLObjectProperty node and it contains owl:topObjectProperty.
      true if this node is an OWLDataProperty node and it contains owl:topDataProperty.
      false if none of the above.
    • isBottomNode

      public boolean isBottomNode()
      Description copied from interface: Node
      Determines if this node represents the bottom node (in a hierarchy). For a named class node, the bottom node is the node that contains owl:Nothing. For an object property node, the bottom node is the node that contains owl:bottomObjectProperty. For a data property node, the bottom node is the node that contains owl:bottomDataProperty
      Specified by:
      isBottomNode in interface Node<E extends OWLObject>
      Returns:
      true if this node is an OWLClass node and it contains owl:Nothing.
      true if this node is an OWLObjectProperty node and it contains owl:bottomObjectProperty.
      true if this node is an OWLDataProperty node and it contains owl:bottomDataProperty.
      false if none of the above.
    • entities

      public Stream<E> entities()
      Description copied from interface: Node
      Gets the entities contained in this node. The entities are equivalent to each other.
      Specified by:
      entities in interface Node<E extends OWLObject>
      Returns:
      stream of entities contained in this Node.
    • getSize

      public int getSize()
      Description copied from interface: Node
      Gets the number of entities contained in this Node.
      Specified by:
      getSize in interface Node<E extends OWLObject>
      Returns:
      The number of entities contained in this node.
    • contains

      public boolean contains(E entity)
      Description copied from interface: Node
      Determines if this node contains the specified entity.
      Specified by:
      contains in interface Node<E extends OWLObject>
      Parameters:
      entity - The entity to check for
      Returns:
      true if this node contains entity, or false if this node does not contain entity
    • getEntitiesMinus

      public Set<E> getEntitiesMinus(E e)
      Description copied from interface: Node
      Gets the entities contained in this node minus the specified entity e. This essentially returns the entities that are returned by Node.getEntities() minus the specified entity e
      Specified by:
      getEntitiesMinus in interface Node<E extends OWLObject>
      Parameters:
      e - The entity that, is contained within this node, but should not be included in the return set.
      Returns:
      The set of entities that are contained in this node minus the specified entity, e. If e is not contained within this node then the full set of entities returned is the same as that returned by Node.getEntities()
    • getEntitiesMinusTop

      public Set<E> getEntitiesMinusTop()
      Description copied from interface: Node
      Gets the entities contained in this node minus the top entity. For a node of named classes the top entity is owl:Thing. For a node of object properties the top entity is owl:topObjectProperty. For a node of data properties the top entity is owl:topDataProperty
      Specified by:
      getEntitiesMinusTop in interface Node<E extends OWLObject>
      Returns:
      The set of entities contained within this node minus the top entity. If this node does not contain the top entity then the set of entities returned is the same as that returned by Node.getEntities().
    • getEntitiesMinusBottom

      public Set<E> getEntitiesMinusBottom()
      Description copied from interface: Node
      Gets the entities contained in this node minus the bottom entity. For a node of named classes the bottom entity is owl:Nothing. For a node of object properties the bottom entity is owl:bottomObjectProperty. For a node of data properties the bottom entity is owl:bottomDataProperty
      Specified by:
      getEntitiesMinusBottom in interface Node<E extends OWLObject>
      Returns:
      The set of entities contained within this node minus the bottom entity. If this node does not contain the bottom entity then the set of entities returned is the same as that returned by Node.getEntities().
    • isSingleton

      public boolean isSingleton()
      Description copied from interface: Node
      Determines if this Node contains just one entity.
      Specified by:
      isSingleton in interface Node<E extends OWLObject>
      Returns:
      true if this Node contains just one entity, otherwise false
    • getRepresentativeElement

      public E getRepresentativeElement()
      Description copied from interface: Node
      Gets one of the entities contained in this entity set. If this is a singleton set it will be the one and only entity.
      Specified by:
      getRepresentativeElement in interface Node<E extends OWLObject>
      Returns:
      An entity from the set of entities contained within this node
    • iterator

      public Iterator<E> iterator()
      Specified by:
      iterator in interface Iterable<E extends OWLObject>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object