Skip to content

Commit

Permalink
ElevationEdgeRender: use pattern matching instanceof
Browse files Browse the repository at this point in the history
  • Loading branch information
flaktack committed Mar 29, 2022
1 parent 9345d6f commit 794ead2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public boolean hasEdgeSegments(Edge edge) {

@Override
public Iterable<T2<Double, Color>> edgeSegments(Edge edge) {
if (edge instanceof StreetEdge) {
if (((StreetEdge) edge).hasElevationExtension()) {
if (edge instanceof StreetEdge streetEdge) {
if (streetEdge.hasElevationExtension()) {
var edgeLength = edge.getDistanceMeters();
var color = Color.DARK_GRAY;

var t2 = new ArrayList<T2<Double, Color>>();
var profile = ((StreetEdge) edge).getElevationProfile();
var profile = streetEdge.getElevationProfile();
for(int i = 0; i < profile.size(); ++i) {
var point = profile.getCoordinate(i);
if (i != 0) {
Expand Down

0 comments on commit 794ead2

Please sign in to comment.