From 548c8770e5ec6cb9bf73b7c341673d4077099a75 Mon Sep 17 00:00:00 2001 From: tknall Date: Thu, 7 Dec 2006 20:13:50 +0000 Subject: knowcenter adjustments from 2006-12-01 merged git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@13 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../wag/egov/egiz/framework/FoundBlock.java | 64 +++++++++++++++------- .../verificators/TextualVerificator_1_0_0.java | 2 +- 2 files changed, 45 insertions(+), 21 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/framework') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/FoundBlock.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/FoundBlock.java index 53afa10..1173666 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/FoundBlock.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/FoundBlock.java @@ -96,7 +96,7 @@ public class FoundBlock /** * Tells, if this block is semantically equal to the other block. * - * Two blocks are semantically equal, if all the required have the + * Two blocks are semantically equal, if all the required fields (except SIG_ID) have the * same captions in the same order. * * @param other_block @@ -106,25 +106,27 @@ public class FoundBlock */ public boolean isSemanticallyEqual(FoundBlock other_block) { - List this_keys = filterOutNonRequiredFoundKeys(this.found_keys); - List other_keys = filterOutNonRequiredFoundKeys(other_block.found_keys); + return this.std.isSemanticallyEqual(other_block.std); - if (this_keys.size() != other_keys.size()) - { - return false; - } - - for (int i = 0; i < this_keys.size(); i++) - { - FoundKey this_found_key = (FoundKey) this_keys.get(i); - FoundKey other_found_key = (FoundKey) other_keys.get(i); - - if (!this_found_key.isSemanticallyEqual(other_found_key)) - { - return false; - } - } - return true; +// List this_keys = filterOutNonRequiredFoundKeys(filterOutSIG_ID(this.found_keys)); +// List other_keys = filterOutNonRequiredFoundKeys(filterOutSIG_ID(other_block.found_keys)); +// +// if (this_keys.size() != other_keys.size()) +// { +// return false; +// } +// +// for (int i = 0; i < this_keys.size(); i++) +// { +// FoundKey this_found_key = (FoundKey) this_keys.get(i); +// FoundKey other_found_key = (FoundKey) other_keys.get(i); +// +// if (!this_found_key.isSemanticallyEqual(other_found_key)) +// { +// return false; +// } +// } +// return true; } /** @@ -132,7 +134,7 @@ public class FoundBlock * * @param found_keys The List of found keys. * - * @return Rturns the subset List which contains only the required keys. + * @return Returns the subset List which contains only the required keys. */ protected static List filterOutNonRequiredFoundKeys (List found_keys) { @@ -150,6 +152,28 @@ public class FoundBlock } return required_found_keys; } + + /** + * Filters out a SIG_ID found key. + * @param found_keys The List of found keys. + * @return Returns the subset List which contains all keys but the SIG_ID. + */ + protected static List filterOutSIG_ID (List found_keys) + { + List nonsigid_found_keys = new ArrayList(found_keys.size()); + for (int i = 0; i < found_keys.size(); i++) + { + FoundKey this_found_key = (FoundKey) found_keys.get(i); + + if (this_found_key.key.equals(SignatureTypes.SIG_ID)) + { + continue; + } + + nonsigid_found_keys.add(this_found_key); + } + return nonsigid_found_keys; + } /** * Tells, if this block is strictly semantically equal to the other block. diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/verificators/TextualVerificator_1_0_0.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/verificators/TextualVerificator_1_0_0.java index bbcebef..fccdfd0 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/verificators/TextualVerificator_1_0_0.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/verificators/TextualVerificator_1_0_0.java @@ -13,7 +13,7 @@ * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS * DERIVATIVES. * - * $Id: TextualVerificator_1_0_0.java,v 1.4 2006/10/31 08:08:00 wprinz Exp $ + * $Id: TextualVerificator_1_0_0.java,v 1.5 2006/11/28 07:45:09 wprinz Exp $ */ package at.knowcenter.wag.egov.egiz.framework.verificators; -- cgit v1.2.3