Class DefaultNodeSet<E extends OWLObject>

java.lang.Object
org.semanticweb.owlapi.reasoner.impl.DefaultNodeSet<E>
Type Parameters:
E - the type of owl objects in the node
All Implemented Interfaces:
Iterable<Node<E>>, NodeSet<E>
Direct Known Subclasses:
OWLClassNodeSet, OWLDataPropertyNodeSet, OWLDatatypeNodeSet, OWLNamedIndividualNodeSet, OWLObjectPropertyNodeSet

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

    • DefaultNodeSet

      public DefaultNodeSet()
      constructor for an empty node set.
    • DefaultNodeSet

      public DefaultNodeSet(E entity)
      Parameters:
      entity - the entity to be contained
    • DefaultNodeSet

      public DefaultNodeSet(Node<E> node)
      Parameters:
      node - the node to be contained
    • DefaultNodeSet

      public DefaultNodeSet(Set<Node<E>> nodes)
      Parameters:
      nodes - a set of nodes to be contained
    • DefaultNodeSet

      public DefaultNodeSet(Stream<Node<E>> nodes)
      Parameters:
      nodes - a set of nodes to be contained
  • Method Details

    • nodes

      public Stream<Node<E>> nodes()
      Description copied from interface: NodeSet
      Gets the Nodes contained in this NodeSet.
      Specified by:
      nodes in interface NodeSet<E extends OWLObject>
      Returns:
      stream of Nodes contained in this NodeSet.
    • addEntity

      public void addEntity(E entity)
      Adds an entity to this NodeSet by wrapping it in a Node.
      Parameters:
      entity - The entity to be added. The entity will be wrapped in the Node and the Node added to this set. Must not be null.
      Throws:
      NullPointerException - if entity is null.
    • addNode

      public void addNode(Node<E> node)
      Adds a Node to this set.
      Parameters:
      node - The Node to be added.
      Throws:
      NullPointerException - if entity is null.
    • addAllNodes

      public void addAllNodes(Collection<Node<E>> nodeset)
      Adds a collection of Nodes to this set.
      Parameters:
      nodeset - The Nodes to be added. Note that if the collection is not a set then duplicate Nodes will be filtered out.
    • addAllNodes

      public void addAllNodes(Stream<Node<E>> nodeset)
      Adds a collection of Nodes to this set.
      Parameters:
      nodeset - The Nodes to be added. Note that if the collection is not a set then duplicate Nodes will be filtered out.
    • addSameEntities

      public void addSameEntities(Set<E> entities)
      Adds the set of entities as a Node to this set.
      Parameters:
      entities - The set of entities to be added. The entities will be wrapped in a Node which will be added to this NodeSet.
    • addDifferentEntities

      public void addDifferentEntities(Set<E> entities)
      Adds the specified entities as Nodes to this set.
      Parameters:
      entities - The entities to be added. Each entity will be wrapped in a Node which will then be added to this NodeSet.
    • entities

      public Stream<E> entities()
      Description copied from interface: NodeSet
      A convenience method that gets all of the entities contained in the Nodes in this NodeSet.
      Specified by:
      entities in interface NodeSet<E extends OWLObject>
      Returns:
      The union of the entities contained in the Nodes in this NodeSet.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface NodeSet<E extends OWLObject>
      Returns:
      true if the node set is empty
    • containsEntity

      public boolean containsEntity(E e)
      Description copied from interface: NodeSet
      A convenience method that determines if this NodeSet contains a specific entity.
      Specified by:
      containsEntity in interface NodeSet<E extends OWLObject>
      Parameters:
      e - The entity to test for
      Returns:
      true if this NodeSet contains a Node that contains the entity, e, and false if this NodeSet does not contain a Node that contains the entity, e.
    • isSingleton

      public boolean isSingleton()
      Description copied from interface: NodeSet
      Determines if this NodeSet is a singleton. A NodeSet is a singleton if it contains only one Node.
      Specified by:
      isSingleton in interface NodeSet<E extends OWLObject>
      Returns:
      true if this NodeSet is a singleton, otherwise false.
    • isTopSingleton

      public boolean isTopSingleton()
      Description copied from interface: NodeSet
      Determines if this NodeSet is a singleton node that only contains the top node (in a hierarchy).
      Specified by:
      isTopSingleton in interface NodeSet<E extends OWLObject>
      Returns:
      true if this NodeSet is a singleton that contains only the top node, and false otherwise.
      See Also:
    • isBottomSingleton

      public boolean isBottomSingleton()
      Description copied from interface: NodeSet
      Determines if this NodeSet is a singleton that only contains the bottom node (in a hierarchy).
      Specified by:
      isBottomSingleton in interface NodeSet<E extends OWLObject>
      Returns:
      true if this NodeSet is a singleton that only contains a node that is the bottom node, otherwise false
      See Also:
    • iterator

      public Iterator<Node<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