Class TopologyException

 1  
 2  
 3  
 4 /*
 5  * Copyright (c) 2016 Vivid Solutions.
 6  *
 7  * All rights reserved. This program and the accompanying materials
 8  * are made available under the terms of the Eclipse Public License 2.0
 9  * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
10  * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html
11  * and the Eclipse Distribution License is available at
12  *
13  * http://www.eclipse.org/org/documents/edl-v10.php.
14  */
15 package org.locationtech.jts.geom;
16  
17 /**
18  * Indicates an invalid or inconsistent topological situation encountered during processing
19  *
20  * @version 1.7
21  */
22 public class TopologyException
23   extends RuntimeException
24 {
25   private static String msgWithCoord(String msg, Coordinate pt)
26   {
27     if (pt != null)
28       return msg + " [ " + pt + " ]";
29     return msg;
30   }
31  
32   private Coordinate pt = null;
33  
34   public TopologyException(String msg)
35   {
36     super(msg);
37   }
38  
39   public TopologyException(String msg, Coordinate pt)
40   {
41     super(msgWithCoord(msg, pt));
42     this.pt = new Coordinate(pt);
43   }
44  
45   public Coordinate getCoordinate() { return pt; }
46  
47 }
48