001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: * (C) 2004 TOPP - www.openplans.org
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: */
017: package org.geotools.validation;
018:
019: import java.util.ArrayList;
020:
021: import org.geotools.feature.Feature;
022:
023: /**
024: * RoadValidationResults purpose.
025: * <p>
026: * Description of RoadValidationResults ...
027: * <p>
028: * Capabilities:
029: * <ul>
030: * </li></li>
031: * </ul>
032: * Example Use:
033: * <pre><code>
034: * RoadValidationResults x = new RoadValidationResults(...);
035: * </code></pre>
036: *
037: * @author bowens, Refractions Research, Inc.
038: * @author $Author: sploreg $ (last modification)
039: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/test/java/org/geotools/validation/RoadValidationResults.java $
040: * @version $Id: RoadValidationResults.java 20884 2006-08-07 14:10:46Z jgarnett $
041: */
042: public class RoadValidationResults implements ValidationResults {
043:
044: public ArrayList validationList;
045: public ArrayList failedFeatures;
046: public ArrayList warningFeatures;
047: public ArrayList failureMessages;
048: public ArrayList warningMessages;
049:
050: /**
051: * RoadValidationResults constructor.
052: * <p>
053: * Description
054: * </p>
055: *
056: */
057: public RoadValidationResults() {
058: validationList = new ArrayList();
059: failedFeatures = new ArrayList();
060: warningFeatures = new ArrayList();
061: failureMessages = new ArrayList();
062: warningMessages = new ArrayList();
063: }
064:
065: /**
066: * Override setValidation.
067: * <p>
068: * Description ...
069: * </p>
070: * @see org.geotools.validation.ValidationResults#setValidation(org.geotools.validation.Validation)
071: *
072: * @param validation
073: */
074: public void setValidation(Validation validation) {
075: validationList.add(validation);
076: }
077:
078: /**
079: * Override error.
080: * <p>
081: * Description ...
082: * </p>
083: * @see org.geotools.validation.ValidationResults#error(org.geotools.feature.Feature, java.lang.String)
084: *
085: * @param feature
086: * @param message
087: */
088: public void error(Feature feature, String message) {
089: failedFeatures.add(feature);
090: failureMessages.add(feature.getID() + ": " + message);
091: }
092:
093: /**
094: * Override warning.
095: * <p>
096: * Description ...
097: * </p>
098: * @see org.geotools.validation.ValidationResults#warning(org.geotools.feature.Feature, java.lang.String)
099: *
100: * @param feature
101: * @param message
102: */
103: public void warning(Feature feature, String message) {
104: warningFeatures.add(feature);
105: warningMessages.add(feature.getID() + ": " + message);
106: }
107:
108: }
|