static class SubgraphDepthLocater.DepthSegment
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
private int |
leftDepth |
private LineSegment |
upwardSeg |
Constructor and Description |
---|
DepthSegment(LineSegment seg,
int depth) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object obj)
Defines a comparison operation on DepthSegments
which orders them left to right.
|
private int |
compareX(LineSegment seg0,
LineSegment seg1)
Compare two collinear segments for left-most ordering.
|
java.lang.String |
toString() |
private LineSegment upwardSeg
private int leftDepth
public DepthSegment(LineSegment seg, int depth)
public int compareTo(java.lang.Object obj)
The definition of the ordering is:
Comparator.compareTo
contract.
This is acceptable for the intended usage, but may cause problems if used with some
utilities in the Java standard library (e.g. Collections.sort()
.
compareTo
in interface java.lang.Comparable
obj
- a DepthSegmentprivate int compareX(LineSegment seg0, LineSegment seg1)
seg0
- a segment to compareseg1
- a segment to comparepublic java.lang.String toString()
toString
in class java.lang.Object