Cleanup. Added toString override for polygonal regions.
This commit is contained in:
@@ -344,12 +344,13 @@ public class CuboidRegion implements Region {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string representation "( (x, y, z) - (x, y, z) )".
|
||||
* Returns string representation in the format
|
||||
* "(minX, minY, minZ) - (maxX, maxY, maxZ)".
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "( "+getMinimumPoint()+" - "+getMaximumPoint()+" )";
|
||||
return getMinimumPoint() + " - " + getMaximumPoint();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,7 +464,26 @@ public class Polygonal2DRegion implements Region {
|
||||
|
||||
return items.iterator();*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns string representation in the format
|
||||
* "(x1, z1) - ... - (xN, zN) * (minY - maxY)"
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
List<BlockVector2D> pts = getPoints();
|
||||
Iterator<BlockVector2D> it = pts.iterator();
|
||||
while (it.hasNext()) {
|
||||
BlockVector2D current = it.next();
|
||||
sb.append("(" + current.getBlockX() + ", " + current.getBlockZ() + ")");
|
||||
if (it.hasNext()) sb.append(" - ");
|
||||
}
|
||||
sb.append(" * (" + minY + " - " + maxY + ")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A terrible polygonal region iterator.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user