diff --git a/src/fr/inrialpes/exmo/align/impl/BasicCell.java b/src/fr/inrialpes/exmo/align/impl/BasicCell.java index c791004635555a886a8cd8aca5919ae47a48fab4..f655b64ace24da81b4971dedc275f4bf42b8c897 100644 --- a/src/fr/inrialpes/exmo/align/impl/BasicCell.java +++ b/src/fr/inrialpes/exmo/align/impl/BasicCell.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA, 2003-2005, 2007-2009 + * Copyright (C) INRIA, 2003-2005, 2007-2010 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -72,6 +72,10 @@ public class BasicCell implements Cell, Comparable<Cell> { } } + public int hashCode() { + return 17 + 7*object1.hashCode() + 11*object2.hashCode() + relation.hashCode() + (int)(strength*150.); + } + /** * Used to order the cells in an alignment: * -- this > c iff this.getStrength() < c.getStrength() -- diff --git a/src/fr/inrialpes/exmo/align/impl/BasicRelation.java b/src/fr/inrialpes/exmo/align/impl/BasicRelation.java index 296775c116b7b145fc33bfde4c5c25f7ca37cd1d..80574c31c3fc587928fe68259d2489ecadcf3f52 100644 --- a/src/fr/inrialpes/exmo/align/impl/BasicRelation.java +++ b/src/fr/inrialpes/exmo/align/impl/BasicRelation.java @@ -108,6 +108,9 @@ public class BasicRelation implements Relation return false; } } + public int hashCode() { + return 19+relation.hashCode(); + } /** Housekeeping **/ public void dump( ContentHandler h ){}; diff --git a/src/fr/inrialpes/exmo/align/impl/ObjectCell.java b/src/fr/inrialpes/exmo/align/impl/ObjectCell.java index 3e811a964da97aaee963c812b40bc2eddf9fd365..b78e7fe9512680f4d0bb4a6c0b443340c5736a57 100644 --- a/src/fr/inrialpes/exmo/align/impl/ObjectCell.java +++ b/src/fr/inrialpes/exmo/align/impl/ObjectCell.java @@ -67,6 +67,11 @@ public class ObjectCell extends BasicCell { } } + public int hashCode() { + return 31 + 7*object1.hashCode() + 11*object2.hashCode() + relation.hashCode() + (int)(strength*150.); + } + + /** * Used to order the cells in an alignment: * -- this > c iff this.getStrength() < c.getStrength() -- diff --git a/src/fr/inrialpes/exmo/align/impl/URICell.java b/src/fr/inrialpes/exmo/align/impl/URICell.java index 550193b1c0020c94c86df96746aabf3c2b67b82a..b7f4ada2397749cf6a51473e76c871c1792b21d4 100644 --- a/src/fr/inrialpes/exmo/align/impl/URICell.java +++ b/src/fr/inrialpes/exmo/align/impl/URICell.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA Rhône-Alpes, 2007-2008 + * Copyright (C) INRIA, 2007-2008, 2010 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -76,6 +76,10 @@ public class URICell extends BasicCell { } } + public int hashCode() { + return 23 + 7*object1.hashCode() + 11*object2.hashCode() + relation.hashCode() + (int)(strength*150.); + } + public URI getObject1AsURI( Alignment al ) throws AlignmentException { return (URI)object1; }; diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java index 848e0599bdda00956a7c93bde7b6060f92d018be..86bbd80f9e0cb8ce123c5334dfc90e35db6a41f5 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java @@ -2,7 +2,7 @@ * $Id$ * * Sourceforge version 1.2 - 2008 - * Copyright (C) INRIA, 2007-2009 + * Copyright (C) INRIA, 2007-2010 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -86,6 +86,10 @@ public class EDOALCell extends BasicCell { } } + public int hashCode() { + return 11 + 7*object1.hashCode() + 11*object2.hashCode() + relation.hashCode() + (int)(strength*150.); + } + // JE// Maybe do it in case Expressions have URI public URI getObject1AsURI( Alignment al ) throws AlignmentException { return null; diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALRelation.java b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALRelation.java index d087cb9cad747979fb9f7f5dc190d28b6ed8ae77..808e5fc3d9360a789afd7aad567472c3be3de0f5 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALRelation.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALRelation.java @@ -2,7 +2,7 @@ * $Id$ * * Sourceforge version 1.3 - 2008 - * Copyright (C) INRIA, 2007-2009 + * Copyright (C) INRIA, 2007-2010 * * 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 @@ -41,6 +41,8 @@ import org.xml.sax.ContentHandler; * In fact, for the EDOAL Mapping language, this encodes directions * but should be rewritten in order to achive a better implementation * + * I feel this is not used anymore + * * @author Jérôme Euzenat * @version $Id$ */ @@ -228,6 +230,10 @@ public class EDOALRelation implements Relation { } } + public int hashCode() { + return 5 + 3*type.hashCode() + 7*direction.hashCode() ; + } + /** Housekeeping **/ public void dump( ContentHandler h ){}; diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Value.java b/src/fr/inrialpes/exmo/align/impl/edoal/Value.java index 11b7c37974e16120cb8dc0722087ca0aeb492146..b220d8fbf3cdc23c5513f77c3d671227b6135309 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/Value.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Value.java @@ -65,7 +65,7 @@ public class Value { //implements Cloneable, Visitable { } public int hashCode() { - return value.hashCode(); + return 5*value.hashCode(); } public boolean equals(final Object o) {