org.semanticweb.elk.reasoner.taxonomy
Class IndividualNode

java.lang.Object
  extended by org.semanticweb.elk.reasoner.taxonomy.IndividualNode
All Implemented Interfaces:
InstanceNode<ElkClass,ElkNamedIndividual>, Node<ElkNamedIndividual>, UpdateableInstanceNode<ElkClass,ElkNamedIndividual>, UpdateableNode<ElkNamedIndividual>

public class IndividualNode
extends Object
implements UpdateableInstanceNode<ElkClass,ElkNamedIndividual>

Class for storing information about a class in the context of classification. It is the main data container for IndividualClassTaxonomy objects. Like most such data containers in ELK, it is read-only for public access but provides package-private ways of modifying it. Modifications of this class happen in implementations of IndividualClassTaxonomy only.

Author:
Yevgeny Kazakov, Markus Kroetzsch

Constructor Summary
protected IndividualNode(Collection<ElkNamedIndividual> members)
          Constructing the class node for a given taxonomy and the set of equivalent classes.
 
Method Summary
 void addDirectTypeNode(UpdateableTypeNode<ElkClass,ElkNamedIndividual> typeNode)
          Add a direct super-class node.
 Set<UpdateableTypeNode<ElkClass,ElkNamedIndividual>> getAllTypeNodes()
          Get an unmodifiable set of TypeNodes of which the members of this InstanceNode are (possibly indirect) instances.
 ElkNamedIndividual getCanonicalMember()
          Get one object to canonically represent the classes in this Node.
 Set<UpdateableTypeNode<ElkClass,ElkNamedIndividual>> getDirectTypeNodes()
          Get an unmodifiable set of nodes for ElkObjects that are direct types of this Node.
 Set<ElkNamedIndividual> getMembers()
          Get an unmodifiable set of objects that this Node represents.
 int hashCode()
           
 boolean isModified()
           
 void removeDirectTypeNode(UpdateableTypeNode<ElkClass,ElkNamedIndividual> typeNode)
           
 void setMembers(Collection<ElkNamedIndividual> members)
           
 String toString()
           
 boolean trySetModified(boolean modified)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndividualNode

protected IndividualNode(Collection<ElkNamedIndividual> members)
Constructing the class node for a given taxonomy and the set of equivalent classes.

Parameters:
taxonomy - the taxonomy to which this node belongs
members - non-empty list of equivalent ElkClass objects
Method Detail

addDirectTypeNode

public void addDirectTypeNode(UpdateableTypeNode<ElkClass,ElkNamedIndividual> typeNode)
Add a direct super-class node. This method is not thread safe.

Specified by:
addDirectTypeNode in interface UpdateableInstanceNode<ElkClass,ElkNamedIndividual>
Parameters:
typeNode - node to add

getMembers

public Set<ElkNamedIndividual> getMembers()
Description copied from interface: Node
Get an unmodifiable set of objects that this Node represents. The membership in this set is checked using the structural equality.

Specified by:
getMembers in interface Node<ElkNamedIndividual>
Returns:
collection of logically equivalent objects

setMembers

public void setMembers(Collection<ElkNamedIndividual> members)

getCanonicalMember

public ElkNamedIndividual getCanonicalMember()
Description copied from interface: Node
Get one object to canonically represent the classes in this Node. It is guaranteed that the least object is the least one according to the ordering defined by PredefinedElkIri.compare(). TODO The above remark is a bit mysterious. Does the interface really make such guarantees?

Specified by:
getCanonicalMember in interface Node<ElkNamedIndividual>
Returns:
canonical object

getDirectTypeNodes

public Set<UpdateableTypeNode<ElkClass,ElkNamedIndividual>> getDirectTypeNodes()
Description copied from interface: InstanceNode
Get an unmodifiable set of nodes for ElkObjects that are direct types of this Node. Get an unmodifiable set of TypeNodes of which the members of this InstanceNode are direct instances. A member is a direct instance of a TypeNode if it is an instance of the TypeNode and not an instance of any sub-node of a TypeNode.

Specified by:
getDirectTypeNodes in interface InstanceNode<ElkClass,ElkNamedIndividual>
Returns:
nodes for direct types of this node's members

getAllTypeNodes

public Set<UpdateableTypeNode<ElkClass,ElkNamedIndividual>> getAllTypeNodes()
Description copied from interface: InstanceNode
Get an unmodifiable set of TypeNodes of which the members of this InstanceNode are (possibly indirect) instances.

Specified by:
getAllTypeNodes in interface InstanceNode<ElkClass,ElkNamedIndividual>
Returns:
list of nodes for instances of this node's members

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

trySetModified

public boolean trySetModified(boolean modified)
Specified by:
trySetModified in interface UpdateableNode<ElkNamedIndividual>

isModified

public boolean isModified()
Specified by:
isModified in interface UpdateableNode<ElkNamedIndividual>

removeDirectTypeNode

public void removeDirectTypeNode(UpdateableTypeNode<ElkClass,ElkNamedIndividual> typeNode)
Specified by:
removeDirectTypeNode in interface UpdateableInstanceNode<ElkClass,ElkNamedIndividual>


Copyright © 2011-2013 Department of Computer Science, University of Oxford. All Rights Reserved.