All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.protege.owlapi.inference.cls.NamedClassExtractor Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package org.protege.owlapi.inference.cls;

import java.util.HashSet;
import java.util.Set;

import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf;
import org.semanticweb.owlapi.util.OWLClassExpressionVisitorAdapter;


public class NamedClassExtractor extends OWLClassExpressionVisitorAdapter {

    Set result = new HashSet();


    public void reset() {
        result.clear();
    }


    public Set getResult() {
        return result;
    }


    public void visit(OWLClass desc) {
        result.add(desc);
    }


    public void visit(OWLObjectIntersectionOf desc) {
        for (OWLClassExpression op : desc.getOperands()) {
            op.accept(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy