Class AbstractGreatArcConnector

Direct Known Subclasses:
InteriorAngleGreatArcConnector

public abstract class AbstractGreatArcConnector extends AbstractPathConnector<AbstractGreatArcConnector.ConnectableGreatArc>
Abstract class for joining collections of great arcs into connected paths. This class is not thread-safe.
  • Constructor Details

    • AbstractGreatArcConnector

      public AbstractGreatArcConnector()
  • Method Details

    • add

      public void add(GreatArc arc)
      Add an arc to the connector, leaving it unconnected until a later call to to connect(Iterable) or connectAll().
      Parameters:
      arc - arc to add
      See Also:
    • add

      public void add(Iterable<GreatArc> arcs)
      Add a collection of arcs to the connector, leaving them unconnected until a later call to connect(Iterable) or connectAll().
      Parameters:
      arcs - arcs to add
      See Also:
    • connect

      public void connect(Iterable<GreatArc> arcs)
      Add a collection of arcs to the connector and attempt to connect each new arc with existing ones. Connections made at this time will not be overwritten by subsequent calls to this or other connection methods, (eg, connectAll()).

      The connector is not reset by this call. Additional arc can still be added to the current set of paths.

      Parameters:
      arcs - arcs to connect
      See Also:
    • connectAll

      public List<GreatArcPath> connectAll(Iterable<GreatArc> arcs)
      Add the given arcs to this instance and connect all current arc into paths. This call is equivalent to
            connector.add(arcs);
            List<GreatArcPath> result = connector.connectAll();
       

      The connector is reset after this call. Further calls to add or connect arcs will result in new paths being generated.

      Parameters:
      arcs - arcs to add
      Returns:
      the connected arc paths
      See Also:
    • connectAll

      public List<GreatArcPath> connectAll()
      Connect all current arcs into connected paths, returning the result as a list of arc paths.

      The connector is reset after this call. Further calls to add or connect arcs will result in new paths being generated.

      Returns:
      the connected line segments paths
    • toPath

      Convert the linked list of path elements starting at the argument into a GreatArcPath.
      Parameters:
      root - root of a connected path linked list
      Returns:
      a great arc path representing the linked list path