diff --git a/src/org/semanticweb/owl/align/Alignment.java b/src/org/semanticweb/owl/align/Alignment.java index c87a5d4cc9282b6f4ecf9be3749e24cd64e64d2e..a7a969a4b565083cdc5c170cab350e23bdd3d806 100644 --- a/src/org/semanticweb/owl/align/Alignment.java +++ b/src/org/semanticweb/owl/align/Alignment.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA, 2003-2005, 2007-2008 + * Copyright (C) INRIA, 2003-2005, 2007-2009 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -37,7 +37,7 @@ import org.xml.sax.ContentHandler; */ -public interface Alignment extends Cloneable, Iterable<Cell> { +public interface Alignment extends Cloneable, Iterable<Cell>, Visitable { /** Initialize the alignement before using it **/ @@ -52,7 +52,6 @@ public interface Alignment extends Cloneable, Iterable<Cell> { /** Alignment methods **/ - public void accept( AlignmentVisitor visitor ) throws AlignmentException; /** * The alignment has reference to the two aligned ontology. * All Alignment cells contain firts the entity from the first ontology @@ -164,6 +163,21 @@ public interface Alignment extends Cloneable, Iterable<Cell> { public Iterator<Cell> iterator(); public int nbCells(); + // What about implementing methods here? + // enum CutMethod { + // HARD, + // ... + // } + /* + * - getting those cells with strength above n (hard) + * - getting the n best cells (best) + * - getting those cells with strength at worse n under the best (span) + * - getting the n% best cells (perc) + * - getting those cells with strength at worse n% of the best (prop) + * - getting all cells until a gap of n (hardgap) + * - getting all cells until a gap of n% of the last (propgap) + */ + public void cut( String method, double threshold ) throws AlignmentException; public void cut( double threshold ) throws AlignmentException; public void harden( double threshold ) throws AlignmentException; diff --git a/src/org/semanticweb/owl/align/AlignmentVisitor.java b/src/org/semanticweb/owl/align/AlignmentVisitor.java index 1cae81e859846fdde92068f41e44c72437741154..b14138ac9a6478f4c5cc11a0dc1ef1ff93b794e1 100644 --- a/src/org/semanticweb/owl/align/AlignmentVisitor.java +++ b/src/org/semanticweb/owl/align/AlignmentVisitor.java @@ -29,7 +29,5 @@ package org.semanticweb.owl.align; public interface AlignmentVisitor { public void init( Parameters p ); - public void visit( Alignment a ) throws AlignmentException; - public void visit( Cell c ) throws AlignmentException; - public void visit( Relation r ) throws AlignmentException; + public void visit( Visitable o ) throws AlignmentException; } diff --git a/src/org/semanticweb/owl/align/Cell.java b/src/org/semanticweb/owl/align/Cell.java index 0e5d247e21a6be6434d4cbe333a0567b54ba9ea2..6933d4ffe9ae3c0466f37fc51ea932cf89b5aff5 100644 --- a/src/org/semanticweb/owl/align/Cell.java +++ b/src/org/semanticweb/owl/align/Cell.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA Rhône-Alpes, 2003-2005, 2007-2008 + * Copyright (C) INRIA, 2003-2005, 2007-2009 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -40,8 +40,7 @@ import org.xml.sax.SAXException; */ -public interface Cell extends Comparable<Cell> { - public void accept( AlignmentVisitor visitor ) throws AlignmentException; +public interface Cell extends Comparable<Cell>, Visitable { /** Creation **/ diff --git a/src/org/semanticweb/owl/align/Relation.java b/src/org/semanticweb/owl/align/Relation.java index fdfc860022663c6ba7338f1f5b742de0c88b83c3..29877e3921783cd098a60f6e2c6967e12e204619 100644 --- a/src/org/semanticweb/owl/align/Relation.java +++ b/src/org/semanticweb/owl/align/Relation.java @@ -31,11 +31,8 @@ import org.xml.sax.ContentHandler; */ -public interface Relation -{ +public interface Relation extends Visitable { /** Creation **/ - public void accept( AlignmentVisitor visitor ) throws AlignmentException; - public String getRelation(); public Relation inverse(); diff --git a/src/org/semanticweb/owl/align/Visitable.java b/src/org/semanticweb/owl/align/Visitable.java new file mode 100644 index 0000000000000000000000000000000000000000..caa1975a6d642762c9cfb83fb97bf5ace8ba4ebe --- /dev/null +++ b/src/org/semanticweb/owl/align/Visitable.java @@ -0,0 +1,32 @@ +/* + * $Id$ + * + * Copyright (C) INRIA, 2009 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package org.semanticweb.owl.align; + +/** + * The interface of the objects that can be visited by a renderer + * + * @author Jérôme Euzenat + * @version $Id$ + */ + +public interface Visitable { + public void accept( AlignmentVisitor visitor ) throws AlignmentException; + }