Class AbstractGreatArcConnector
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.internal.AbstractPathConnector<AbstractGreatArcConnector.ConnectableGreatArc>
-
- org.apache.commons.geometry.spherical.twod.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractGreatArcConnector.ConnectableGreatArc
Internal class for connectingGreatArc
s intoGreatArcPath
s.-
Nested classes/interfaces inherited from class org.apache.commons.geometry.euclidean.internal.AbstractPathConnector
AbstractPathConnector.ConnectableElement<E extends AbstractPathConnector.ConnectableElement<E>>
-
-
Constructor Summary
Constructors Constructor Description AbstractGreatArcConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.Iterable<GreatArc> arcs)
Add a collection of arcs to the connector, leaving them unconnected until a later call toconnect(Iterable)
orconnectAll()
.void
add(GreatArc arc)
Add an arc to the connector, leaving it unconnected until a later call to toconnect(Iterable)
orconnectAll()
.void
connect(java.lang.Iterable<GreatArc> arcs)
Add a collection of arcs to the connector and attempt to connect each new arc with existing ones.java.util.List<GreatArcPath>
connectAll()
Connect all current arcs into connected paths, returning the result as a list of arc paths.java.util.List<GreatArcPath>
connectAll(java.lang.Iterable<GreatArc> arcs)
Add the given arcs to this instance and connect all current arc into paths.private GreatArcPath
toPath(AbstractGreatArcConnector.ConnectableGreatArc root)
Convert the linked list of path elements starting at the argument into aGreatArcPath
.-
Methods inherited from class org.apache.commons.geometry.euclidean.internal.AbstractPathConnector
addPathElement, computePathRoots, connectPathElements, selectConnection, selectPointConnection
-
-
-
-
Method Detail
-
add
public void add(GreatArc arc)
Add an arc to the connector, leaving it unconnected until a later call to toconnect(Iterable)
orconnectAll()
.- Parameters:
arc
- arc to add- See Also:
connect(Iterable)
,connectAll()
-
add
public void add(java.lang.Iterable<GreatArc> arcs)
Add a collection of arcs to the connector, leaving them unconnected until a later call toconnect(Iterable)
orconnectAll()
.- Parameters:
arcs
- arcs to add- See Also:
connect(Iterable)
,connectAll()
,add(GreatArc)
-
connect
public void connect(java.lang.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()
-
connectAll
public java.util.List<GreatArcPath> connectAll(java.lang.Iterable<GreatArc> arcs)
Add the given arcs to this instance and connect all current arc into paths. This call is equivalent toconnector.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:
add(Iterable)
,connectAll()
-
connectAll
public java.util.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
private GreatArcPath toPath(AbstractGreatArcConnector.ConnectableGreatArc root)
Convert the linked list of path elements starting at the argument into aGreatArcPath
.- Parameters:
root
- root of a connected path linked list- Returns:
- a great arc path representing the linked list path
-
-