org.semanticweb.elk.reasoner.indexing.entries.IndexedEntryConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elk-reasoner Show documentation
Show all versions of elk-reasoner Show documentation
ELK consequence-based reasoning engine
/*
* #%L
* ELK Reasoner
*
* $Id$
* $HeadURL$
* %%
* Copyright (C) 2011 Department of Computer Science, University of Oxford
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package org.semanticweb.elk.reasoner.indexing.entries;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedAxiom;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedBinaryPropertyChain;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedClass;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedClassExpression;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedDataHasValue;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedDisjointnessAxiom;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedIndividual;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObjectComplementOf;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObjectIntersectionOf;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObjectProperty;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObjectSomeValuesFrom;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObjectUnionOf;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedPropertyChain;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedSubClassOfAxiom;
import org.semanticweb.elk.reasoner.indexing.visitors.IndexedAxiomVisitor;
import org.semanticweb.elk.reasoner.indexing.visitors.IndexedClassExpressionVisitor;
import org.semanticweb.elk.reasoner.indexing.visitors.IndexedPropertyChainVisitor;
import org.semanticweb.elk.util.collections.entryset.KeyEntry;
import org.semanticweb.elk.util.collections.entryset.KeyEntryHashSet;
/**
* A visitor for {@link IndexedClassExpression}s and
* {@link IndexedPropertyChain}s that wraps the visited objects in the
* corresponding Entry wrapper to redefine equality.
*
* @author Frantisek Simancik
* @author "Yevgeny Kazakov"
*
* @param
* the type of the elements for which the wrapped entries can be used
* @see KeyEntryHashSet
*/
public class IndexedEntryConverter
implements
IndexedAxiomVisitor>,
IndexedClassExpressionVisitor>,
IndexedPropertyChainVisitor> {
@Override
public IndexedClassExpressionEntry visit(
IndexedClass element) {
return new IndexedClassEntry(element);
}
@Override
public IndexedClassExpressionEntry visit(
IndexedObjectComplementOf element) {
return new IndexedObjectComplementOfEntry(
element);
}
@Override
public IndexedClassExpressionEntry visit(
IndexedObjectIntersectionOf element) {
return new IndexedObjectIntersectionOfEntry(
element);
}
@Override
public IndexedClassExpressionEntry visit(
IndexedObjectSomeValuesFrom element) {
return new IndexedObjectSomeValuesFromEntry(
element);
}
@Override
public KeyEntry visit(
IndexedObjectUnionOf element) {
return new IndexedObjectUnionOfEntry(element);
}
@Override
public IndexedClassExpressionEntry visit(
IndexedDataHasValue element) {
return new IndexedDataHasValueEntry(element);
}
@Override
public IndexedPropertyChainEntry visit(
IndexedObjectProperty element) {
return new IndexedObjectPropertyEntry(element);
}
@Override
public IndexedPropertyChainEntry visit(
IndexedBinaryPropertyChain element) {
return new IndexedBinaryPropertyChainEntry(
element);
}
@Override
public IndexedIndividualEntry visit(
IndexedIndividual element) {
return new IndexedIndividualEntry(element);
}
@Override
public KeyEntry visit(
IndexedSubClassOfAxiom axiom) {
return new IndexedSubClassOfAxiomEntry(axiom);
}
@Override
public KeyEntry visit(
IndexedDisjointnessAxiom axiom) {
return new IndexedDisjointnessAxiomEntry(
axiom);
}
}