Skip to content

Commit

Permalink
Use named constants for dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Dec 14, 2024
1 parent 0d3dc13 commit 33fd2a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ public MultiLineString(LineString[] lineStrings, GeometryFactory factory) {
}

public int getDimension() {
return 1;
return Dimension.L;
}

public boolean hasDimension(int dim) {
return dim == 1;
return dim == Dimension.L;
}

public int getBoundaryDimension() {
if (isClosed()) {
return Dimension.FALSE;
}
return 0;
return Dimension.P;
}

public String getGeometryType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public MultiPoint(Point[] points, GeometryFactory factory) {
}

public int getDimension() {
return 0;
return Dimension.P;
}

public boolean hasDimension(int dim) {
return dim == 0;
return dim == Dimension.P;
}

public int getBoundaryDimension() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public MultiPolygon(Polygon[] polygons, GeometryFactory factory) {
}

public int getDimension() {
return 2;
return Dimension.A;
}

public boolean hasDimension(int dim) {
return dim == 2;
return dim == Dimension.A;
}

public int getBoundaryDimension() {
return 1;
return Dimension.L;
}

public String getGeometryType() {
Expand Down

0 comments on commit 33fd2a9

Please sign in to comment.