Interface GeometryComponentFilter

 1  
 2  
 3 /*
 4  * Copyright (c) 2016 Vivid Solutions.
 5  *
 6  * All rights reserved. This program and the accompanying materials
 7  * are made available under the terms of the Eclipse Public License 2.0
 8  * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
 9  * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html
10  * and the Eclipse Distribution License is available at
11  *
12  * http://www.eclipse.org/org/documents/edl-v10.php.
13  */
14 package org.locationtech.jts.geom;
15  
16  
17 /**
18  *  <code>Geometry</code> classes support the concept of applying
19  *  a <code>GeometryComponentFilter</code>
20  *  filter to the <code>Geometry</code>.
21  *  The filter is applied to every component of the <code>Geometry</code>
22  *  which is itself a <code>Geometry</code>
23  *  and which does not itself contain any components.
24  * (For instance, all the {@link LinearRing}s in {@link Polygon}s are visited,
25  * but in a {@link MultiPolygon} the {@link Polygon}s themselves are not visited.)
26  * Thus the only classes of Geometry which must be 
27  * handled as arguments to {@link #filter}
28  * are {@link LineString}s, {@link LinearRing}s and {@link Point}s.
29  *  <p>
30  *  A <code>GeometryComponentFilter</code> filter can either
31  *  record information about the <code>Geometry</code>
32  *  or change the <code>Geometry</code> in some way.
33  *  <code>GeometryComponentFilter</code>
34  *  is an example of the Gang-of-Four Visitor pattern.
35  *
36  *@version 1.7
37  */
38 public interface GeometryComponentFilter {
39  
40   /**
41    *  Performs an operation with or on <code>geom</code>.
42    *
43    *@param  geom  a <code>Geometry</code> to which the filter is applied.
44    */
45   void filter(Geometry geom);
46 }
47  
48