org.apache.commons.math3.geometry.euclidean.twod

## Class PolygonsSet.ComparableSegment

- java.lang.Object
- - org.apache.commons.math3.geometry.euclidean.twod.Segment
  - - org.apache.commons.math3.geometry.euclidean.twod.PolygonsSet.ComparableSegment

All Implemented Interfaces:
  java.lang.Comparable<PolygonsSet.ComparableSegment>

Enclosing class:
  PolygonsSet

    private static class PolygonsSet.ComparableSegment
    extends Segment
    implements java.lang.Comparable<PolygonsSet.ComparableSegment>

Private extension of Segment allowing comparison.

### Field Summary

Fields
`private OrderedTuple` `sortingKey` Sorting key.

### Constructor Summary

Constructors
Constructor and Description
`PolygonsSet.ComparableSegment(Vector2D start, double dx, double dy)` Build a dummy segment.
`PolygonsSet.ComparableSegment(Vector2D start, Vector2D end, Line line)` Build a segment.

### Method Summary

Methods
`int` `compareTo(PolygonsSet.ComparableSegment o)`
`boolean` `equals(java.lang.Object other)`
`int` `hashCode()`

### Methods inherited from class org.apache.commons.math3.geometry.euclidean.twod.Segment

`distance, getEnd, getLine, getStart`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### sortingKey

    private OrderedTuple sortingKey

Sorting key.

### Constructor Detail

#### PolygonsSet.ComparableSegment

    public PolygonsSet.ComparableSegment(Vector2D start,
                                 Vector2D end,
                                 Line line)

Build a segment.

Parameters:
  `start` - start point of the segment
  `end` - end point of the segment
  `line` - line containing the segment

#### PolygonsSet.ComparableSegment

    public PolygonsSet.ComparableSegment(Vector2D start,
                                 double dx,
                                 double dy)

Build a dummy segment.

The object built is not a real segment, only the sorting key is used to allow searching in the neighborhood of a point. This is an horrible hack ...

Parameters:
  `start` - start point of the segment
  `dx` - abscissa offset from the start point
  `dy` - ordinate offset from the start point

### Method Detail

#### compareTo

    public int compareTo(PolygonsSet.ComparableSegment o)

Specified by:
  `compareTo` in interface `java.lang.Comparable<PolygonsSet.ComparableSegment>`

#### equals

    public boolean equals(java.lang.Object other)

Overrides:
  `equals` in class `java.lang.Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`