| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
package org.locationtech.jts.geomgraph; |
| 16 |
|
| 17 |
/** |
| 18 |
* A Position indicates the position of a Location relative to a graph component |
| 19 |
* (Node, Edge, or Area). |
| 20 |
* @version 1.7 |
| 21 |
*/ |
| 22 |
public class Position { |
| 23 |
|
| 24 |
/** An indicator that a Location is <i>on</i> a GraphComponent */ |
| 25 |
public static final int ON = 0; |
| 26 |
/** An indicator that a Location is to the <i>left</i> of a GraphComponent */ |
| 27 |
public static final int LEFT = 1; |
| 28 |
/** An indicator that a Location is to the <i>right</i> of a GraphComponent */ |
| 29 |
public static final int RIGHT = 2; |
| 30 |
/** |
| 31 |
* Returns LEFT if the position is RIGHT, RIGHT if the position is LEFT, or the position |
| 32 |
* otherwise. |
| 33 |
*/ |
| 34 |
public static final int opposite(int position) |
| 35 |
{ |
| 36 |
if (position == LEFT) return RIGHT; |
| 37 |
if (position == RIGHT) return LEFT; |
| 38 |
return position; |
| 39 |
} |
| 40 |
} |
| 41 |
|