lv.lumii.layoutengine.obstacleGraph

## Class Segment

- java.lang.Object
- - lv.lumii.layoutengine.obstacleGraph.Segment

- All Implemented Interfaces:
    java.lang.Comparable<Segment>
  Direct Known Subclasses:
    SimpleOrthogonalSegment

      public class Segment
      extends java.lang.Object
      implements java.lang.Comparable<Segment>

  Orthogonal segment for obstacle graph calculation.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Segment.VerticalPart<S extends Segment>` A class for storing sweep-line segment projections on vertical axis.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `double` | `end` The end coordinate of the segment.
    `double` | `pos` The position of the segment.
    `double` | `start` The start coordinate of the segment.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Segment(double pos, double start, double end)` Creates a new Segment object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Segment s)` Compares the two specified segments by their `pos` value.
    `double` | `getEnd()` Returns the end position of the segment.
    `double` | `getPos()` Returns the segments position.
    `double` | `getStart()` Returns the start position of the segment.
    `void` | `setEnd(double end)` Sets the end position of the segment.
    `void` | `setPos(double pos)` Changes the position of the segment without moving the corresponding element.
    `void` | `setStart(double start)` Sets the start position of the segment.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### pos

          public double pos

      The position of the segment.

    - #### start

          public double start

      The start coordinate of the segment.

    - #### end

          public double end

      The end coordinate of the segment.

  - ### Constructor Detail

    - #### Segment

          public Segment(double pos,
                         double start,
                         double end)

      Creates a new Segment object.
      Parameters:
        `pos` - the position of the new Segment
        `start` - the start of the new Segment
        `end` - the end of the new Segment

  - ### Method Detail

    - #### getPos

          public double getPos()

      Returns the segments position.
      Returns:
        the segments position.

    - #### setPos

          public void setPos(double pos)

      Changes the position of the segment without moving the corresponding element.
      Parameters:
        `pos` - the new abscissa

    - #### getStart

          public double getStart()

      Returns the start position of the segment.
      Returns:
        the start position of the segment.

    - #### getEnd

          public double getEnd()

      Returns the end position of the segment.
      Returns:
        the end position of the segment.

    - #### setStart

          public void setStart(double start)

      Sets the start position of the segment.
      Parameters:
        `start` - the new start position of the segment.

    - #### setEnd

          public void setEnd(double end)

      Sets the end position of the segment.
      Parameters:
        `end` - the new end position of the segment.

    - #### compareTo

          public int compareTo(Segment s)

      Compares the two specified segments by their `pos` value.
      Specified by:
        `compareTo` in interface `java.lang.Comparable<Segment>`
      Parameters:
        `s` - the segment to compare to
      Returns:
        the value 0 if both `pos` are numerically equal; a value less than 0 if the value of the first `pos` is numerically less than that of the second; and a value greater than 0 if d1 the value of the first `pos` is numerically greater than that of the second.