org.semanticweb.owlapi.util
Class OWLObjectWalker<O extends OWLObject>

java.lang.Object
  extended by org.semanticweb.owlapi.util.OWLObjectWalker<O>
Direct Known Subclasses:
OWLClassLiteralCollector, OWLOntologyWalker

public class OWLObjectWalker<O extends OWLObject>
extends java.lang.Object

Author: Matthew Horridge
The University Of Manchester
Information Management Group
Date: 29-Jul-2008


Constructor Summary
OWLObjectWalker(java.util.Set<O> objects)
           
OWLObjectWalker(java.util.Set<O> objects, boolean visitDuplicates)
           
 
Method Summary
 OWLAnnotation getAnnotation()
          Gets the last annotation to be visited.
 OWLAxiom getAxiom()
          Gets the last axiom to be visited.
 java.util.List<OWLClassExpression> getClassExpressionPath()
          Gets the current class expression path.
 java.util.List<OWLDataRange> getDataRangePath()
          Gets the current data range path.
 OWLOntology getOntology()
          Gets the last ontology to be visited.
 boolean isFirstClassExpressionInPath(OWLClassExpression classExpression)
          Determines if a particular class expression is the first (or root) class expression in the current class expression path
 void walkStructure(OWLObjectVisitorEx visitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWLObjectWalker

public OWLObjectWalker(java.util.Set<O> objects)

OWLObjectWalker

public OWLObjectWalker(java.util.Set<O> objects,
                       boolean visitDuplicates)
Method Detail

walkStructure

public void walkStructure(OWLObjectVisitorEx visitor)

getOntology

public OWLOntology getOntology()
Gets the last ontology to be visited.

Returns:
The last ontology to be visited

getAxiom

public OWLAxiom getAxiom()
Gets the last axiom to be visited.

Returns:
The last axiom to be visited, or null if an axiom has not be visited

getAnnotation

public OWLAnnotation getAnnotation()
Gets the last annotation to be visited.

Returns:
The last annotation to be visited (may be null)

getClassExpressionPath

public java.util.List<OWLClassExpression> getClassExpressionPath()
Gets the current class expression path. The current class expression path is a list of class expressions that represents the containing expressions for the current class expressions. The first item in the path (list) is the root class expression that was visited. For 0 < i < pathLength, the item at index i+1 is a direct sub-expression of the item at index i. The last item in the path is the current class expression being visited.

Returns:
A list of class expressions that represents the path of class expressions, with the root of the class expression being the first element in the list.

isFirstClassExpressionInPath

public boolean isFirstClassExpressionInPath(OWLClassExpression classExpression)
Determines if a particular class expression is the first (or root) class expression in the current class expression path

Parameters:
classExpression - The class expression
Returns:
true if the specified class expression is the first class expression in the current class expression path, otherwise false (false if the path is empty)

getDataRangePath

public java.util.List<OWLDataRange> getDataRangePath()
Gets the current data range path. The current data range path is a list of data ranges that represents the containing expressions for the current data ranges. The first item in the path (list) is the root data range that was visited. For 0 < i < pathLength, the item at index i+1 is a direct sub-expression of the item at index i. The last item in the path is the current data range being visited.

Returns:
A list of data ranges that represents the path of data ranges, with the root of the data range being the first element in the list.