Class AbstractGreatArcConnector.ConnectableGreatArc
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.internal.AbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>
-
- org.apache.commons.geometry.spherical.twod.AbstractGreatArcConnector.ConnectableGreatArc
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractGreatArcConnector.ConnectableGreatArc>
- Enclosing class:
- AbstractGreatArcConnector
protected static class AbstractGreatArcConnector.ConnectableGreatArc extends AbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>
Internal class for connectingGreatArcs intoGreatArcPaths.
-
-
Constructor Summary
Constructors Modifier Constructor Description ConnectableGreatArc(GreatArc arc)Create a new instance from the given arc.ConnectableGreatArc(Point2S start)Create a new instance with the given start point.privateConnectableGreatArc(Point2S start, GreatArc arc)Create a new instance with the given start point and arc.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConnectTo(AbstractGreatArcConnector.ConnectableGreatArc next)Return true if this instance's end point can be connected to the argument's start point.intcompareTo(AbstractGreatArcConnector.ConnectableGreatArc other)booleanendPointsEq(AbstractGreatArcConnector.ConnectableGreatArc other)Return true if the end point of this instance should be considered equivalent to the end point of the argument.booleanequals(java.lang.Object obj)GreatArcgetArc()Get the arc for the instance.AbstractGreatArcConnector.ConnectableGreatArcgetConnectionSearchKey()Get a new instance used as a search key to help locate other elements with start points matching this instance's end point.doublegetRelativeAngle(AbstractGreatArcConnector.ConnectableGreatArc other)Return the relative angle between this element and the argument.protected AbstractGreatArcConnector.ConnectableGreatArcgetSelf()Return the current instance as the generic type.booleanhasEnd()Return true if this instance has an end point that can be connected to another element's start point.inthashCode()booleanhasStart()Return true if this instance has a start point that can be connected to another element's end point.booleanhasZeroSize()Return true if this instance has a size equivalent to zero.booleanshouldContinueConnectionSearch(AbstractGreatArcConnector.ConnectableGreatArc candidate, boolean ascending)Return true if the search for possible connections should continue through the sorted set of possible path elements given the current candidate element and search direction.-
Methods inherited from class org.apache.commons.geometry.euclidean.internal.AbstractPathConnector.ConnectableElement
connectTo, exportPath, getNext, getPrevious, hasNext, hasPrevious, markExported, setNext, setPrevious
-
-
-
-
Constructor Detail
-
ConnectableGreatArc
public ConnectableGreatArc(Point2S start)
Create a new instance with the given start point. This constructor is intended only for performing searches for other path elements.- Parameters:
start- start point
-
ConnectableGreatArc
public ConnectableGreatArc(GreatArc arc)
Create a new instance from the given arc.- Parameters:
arc- arc for the instance
-
-
Method Detail
-
getArc
public GreatArc getArc()
Get the arc for the instance.- Returns:
- the arc for the instance
-
hasStart
public boolean hasStart()
Return true if this instance has a start point that can be connected to another element's end point.- Specified by:
hasStartin classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Returns:
- true if this instance has a start point that can be connected to another element's end point
-
hasEnd
public boolean hasEnd()
Return true if this instance has an end point that can be connected to another element's start point.- Specified by:
hasEndin classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Returns:
- true if this instance has an end point that can be connected to another element's start point
-
endPointsEq
public boolean endPointsEq(AbstractGreatArcConnector.ConnectableGreatArc other)
Return true if the end point of this instance should be considered equivalent to the end point of the argument.- Specified by:
endPointsEqin classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Parameters:
other- element to compare end points with- Returns:
- true if this instance has an end point equivalent to that of the argument
-
hasZeroSize
public boolean hasZeroSize()
Return true if this instance has a size equivalent to zero.- Returns:
- true if this instance has a size equivalent to zero.
-
canConnectTo
public boolean canConnectTo(AbstractGreatArcConnector.ConnectableGreatArc next)
Return true if this instance's end point can be connected to the argument's start point.- Specified by:
canConnectToin classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Parameters:
next- candidate for the next element in the path; this value is guaranteed to not be null and to contain a start point- Returns:
- true if this instance's end point can be connected to the argument's start point
-
getRelativeAngle
public double getRelativeAngle(AbstractGreatArcConnector.ConnectableGreatArc other)
Return the relative angle between this element and the argument.- Specified by:
getRelativeAnglein classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Parameters:
other- element to compute the angle with- Returns:
- the relative angle between this element and the argument
-
getConnectionSearchKey
public AbstractGreatArcConnector.ConnectableGreatArc getConnectionSearchKey()
Get a new instance used as a search key to help locate other elements with start points matching this instance's end point. The only restriction on the returned instance is that it be compatible with the implementation class'Comparable.compareTo(Object)method.- Specified by:
getConnectionSearchKeyin classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Returns:
- a new instance used to help locate other path elements with start points equivalent to this instance's end point
-
shouldContinueConnectionSearch
public boolean shouldContinueConnectionSearch(AbstractGreatArcConnector.ConnectableGreatArc candidate, boolean ascending)
Return true if the search for possible connections should continue through the sorted set of possible path elements given the current candidate element and search direction. The search operation stops for the given direction when this method returns false.- Specified by:
shouldContinueConnectionSearchin classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Parameters:
candidate- last tested candidate connection elementascending- true if the search is proceeding in an ascending direction; false otherwise- Returns:
- true if the connection search should continue
-
compareTo
public int compareTo(AbstractGreatArcConnector.ConnectableGreatArc other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getSelf
protected AbstractGreatArcConnector.ConnectableGreatArc getSelf()
Return the current instance as the generic type.- Specified by:
getSelfin classAbstractPathConnector.ConnectableElement<AbstractGreatArcConnector.ConnectableGreatArc>- Returns:
- the current instance as the generic type.
-
-