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
- Direct Known Subclasses:
OWLClassNodeSet
,OWLDataPropertyNodeSet
,OWLDatatypeNodeSet
,OWLNamedIndividualNodeSet
,OWLObjectPropertyNodeSet
- Since:
- 3.0.0
- Author:
- Matthew Horridge, The University of Manchester, Information Management Group
-
Constructor Summary
ConstructorsConstructorDescriptionconstructor for an empty node set.DefaultNodeSet
(E entity) DefaultNodeSet
(Set<Node<E>> nodes) DefaultNodeSet
(Stream<Node<E>> nodes) DefaultNodeSet
(Node<E> node) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllNodes
(Collection<Node<E>> nodeset) Adds a collection ofNode
s to this set.void
addAllNodes
(Stream<Node<E>> nodeset) Adds a collection ofNode
s to this set.void
addDifferentEntities
(Set<E> entities) Adds the specified entities asNode
s to this set.void
Adds an entity to thisNodeSet
by wrapping it in aNode
.void
Adds aNode
to this set.void
addSameEntities
(Set<E> entities) Adds the set of entities as aNode
to this set.boolean
containsEntity
(E e) A convenience method that determines if thisNodeSet
contains a specific entity.entities()
A convenience method that gets all of the entities contained in theNodes
in thisNodeSet
.boolean
int
hashCode()
boolean
Determines if thisNodeSet
is a singleton that only contains the bottom node (in a hierarchy).boolean
isEmpty()
boolean
Determines if thisNodeSet
is a singleton.boolean
Determines if thisNodeSet
is a singleton node that only contains the top node (in a hierarchy).iterator()
nodes()
Gets theNode
s contained in thisNodeSet
.toString()
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.semanticweb.owlapi.reasoner.NodeSet
getFlattened, getNodes
-
Constructor Details
-
DefaultNodeSet
public DefaultNodeSet()constructor for an empty node set. -
DefaultNodeSet
- Parameters:
entity
- the entity to be contained
-
DefaultNodeSet
- Parameters:
node
- the node to be contained
-
DefaultNodeSet
- Parameters:
nodes
- a set of nodes to be contained
-
DefaultNodeSet
- Parameters:
nodes
- a set of nodes to be contained
-
-
Method Details
-
nodes
Description copied from interface:NodeSet
Gets theNode
s contained in thisNodeSet
. -
addEntity
Adds an entity to thisNodeSet
by wrapping it in aNode
.- Parameters:
entity
- The entity to be added. The entity will be wrapped in theNode
and theNode
added to this set. Must not benull
.- Throws:
NullPointerException
- ifentity
isnull
.
-
addNode
Adds aNode
to this set.- Parameters:
node
- TheNode
to be added.- Throws:
NullPointerException
- ifentity
isnull
.
-
addAllNodes
Adds a collection ofNode
s to this set.- Parameters:
nodeset
- TheNode
s to be added. Note that if the collection is not a set then duplicateNode
s will be filtered out.
-
addAllNodes
Adds a collection ofNode
s to this set.- Parameters:
nodeset
- TheNode
s to be added. Note that if the collection is not a set then duplicateNode
s will be filtered out.
-
addSameEntities
Adds the set of entities as aNode
to this set.- Parameters:
entities
- The set of entities to be added. The entities will be wrapped in aNode
which will be added to thisNodeSet
.
-
addDifferentEntities
Adds the specified entities asNode
s to this set.- Parameters:
entities
- The entities to be added. Each entity will be wrapped in aNode
which will then be added to thisNodeSet
.
-
entities
Description copied from interface:NodeSet
A convenience method that gets all of the entities contained in theNodes
in thisNodeSet
. -
isEmpty
public boolean isEmpty() -
containsEntity
Description copied from interface:NodeSet
A convenience method that determines if thisNodeSet
contains a specific entity.- Specified by:
containsEntity
in interfaceNodeSet<E extends OWLObject>
- Parameters:
e
- The entity to test for- Returns:
true
if thisNodeSet
contains aNode
that contains the entity,e
, andfalse
if thisNodeSet
does not contain aNode
that contains the entity,e
.
-
isSingleton
public boolean isSingleton()Description copied from interface:NodeSet
Determines if thisNodeSet
is a singleton. ANodeSet
is a singleton if it contains only oneNode
.- Specified by:
isSingleton
in interfaceNodeSet<E extends OWLObject>
- Returns:
true
if thisNodeSet
is a singleton, otherwisefalse
.
-
isTopSingleton
public boolean isTopSingleton()Description copied from interface:NodeSet
Determines if thisNodeSet
is a singleton node that only contains the top node (in a hierarchy).- Specified by:
isTopSingleton
in interfaceNodeSet<E extends OWLObject>
- Returns:
true
if thisNodeSet
is a singleton that contains only the top node, andfalse
otherwise.- See Also:
-
isBottomSingleton
public boolean isBottomSingleton()Description copied from interface:NodeSet
Determines if thisNodeSet
is a singleton that only contains the bottom node (in a hierarchy).- Specified by:
isBottomSingleton
in interfaceNodeSet<E extends OWLObject>
- Returns:
true
if thisNodeSet
is a singleton that only contains a node that is the bottom node, otherwisefalse
- See Also:
-
iterator
-
toString
-
equals
-
hashCode
public int hashCode()
-