org.geotools.validation.spatial
Class LineMustBeASinglePartValidation

java.lang.Object
  extended byorg.geotools.validation.DefaultFeatureValidation
      extended byorg.geotools.validation.spatial.LineMustBeASinglePartValidation
All Implemented Interfaces:
FeatureValidation, Validation

public class LineMustBeASinglePartValidation
extends DefaultFeatureValidation

LineIsSingleSegmentFeatureValidation purpose.

Tests to see if a LineString is made of only one segment, meaning it only has two points. If the LineString has more than two points, the test fails.

Capabilities:

Example Use:

 LineIsSingleSegmentFeatureValidation x = new LineIsSingleSegmentFeatureValidation("noSelfIntersectRoads", "Tests to see if a 
 geometry intersects itself", new String[] {"road"});
 


Field Summary
 
Fields inherited from interface org.geotools.validation.Validation
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL
 
Constructor Summary
LineMustBeASinglePartValidation()
          LineIsSingleSegmentFeatureValidation constructor.
 
Method Summary
 int getPriority()
          Override getPriority.
 boolean validate(org.geotools.feature.Feature feature, org.geotools.feature.FeatureType type, ValidationResults results)
          Override validate.
 
Methods inherited from class org.geotools.validation.DefaultFeatureValidation
getDescription, getName, getTypeRef, getTypeRefs, setDescription, setName, setTypeRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineMustBeASinglePartValidation

public LineMustBeASinglePartValidation()
LineIsSingleSegmentFeatureValidation constructor.

Description

Method Detail

getPriority

public int getPriority()
Override getPriority.

Sets the priority level of this validation.

Specified by:
getPriority in interface Validation
Overrides:
getPriority in class DefaultFeatureValidation
Returns:
A made up priority for this validation.
See Also:
Validation.getPriority()

validate

public boolean validate(org.geotools.feature.Feature feature,
                        org.geotools.feature.FeatureType type,
                        ValidationResults results)
Override validate.

Tests to see if a LineString is made of only one segment, meaning it only has two points. If the LineString has more than two points, the test fails.

Specified by:
validate in interface FeatureValidation
Overrides:
validate in class DefaultFeatureValidation
Parameters:
feature - The Feature to be validated
type - The FeatureTypeInfo of the feature
results - The storage for error messages.
Returns:
True if the feature is simple (one segment).
See Also:
org.geotools.validation.FeatureValidation#validate(org.geotools.feature.Feature, org.geotools.feature.FeatureTypeInfo, org.geotools.validation.ValidationResults)