determineBoundary static method

int determineBoundary(
  1. BoundaryNodeRule boundaryNodeRule,
  2. int boundaryCount
)

This method implements the Boundary Determination Rule for determining whether a component (node or edge) that appears multiple times in elements of a MultiGeometry is in the boundary or the interior of the Geometry
The SFS uses the "Mod-2 Rule", which this function implements
An alternative (and possibly more intuitive) rule would be the "At Most One Rule": isInBoundary = (componentCount == 1)

Implementation

/*
 static bool isInBoundary(int boundaryCount)
{
  // the "Mod-2 Rule"
  return boundaryCount % 2 == 1;
}
 static int determineBoundary(int boundaryCount)
{
  return isInBoundary(boundaryCount) ? Location.BOUNDARY : Location.INTERIOR;
}
*/

static int determineBoundary(
    BoundaryNodeRule boundaryNodeRule, int boundaryCount) {
  return boundaryNodeRule.isInBoundary(boundaryCount)
      ? Location.BOUNDARY
      : Location.INTERIOR;
}