Package com.treemap.swing.voronoi.smoothing

# Class LineSegmentContainer

java.lang.Object
com.treemap.swing.voronoi.smoothing.LineSegmentContainer

public class LineSegmentContainer extends Object
This class is a container for LineSegments. LineSegments are smooth connecting splines between corners (or vertexes) of voronoi cell outline shapes. If a LineSegment in the opposite direction (exchanged start and end points) already exists in the container it will not be added again.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LineSegmentContainer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SegmentDirection`
  `addIfNotContained(LineSegment lineSegmentToAdd)`
  Adds a line segment only if a line segment in the opposite direction (exchanged start and end points) not already exists in the container.
  `LineSegment`
  `getReference(LineSegment currentSegment)`
  Returns the reference to the corresponding line segment in the container.

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

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

- ## Constructor Details

  - ### LineSegmentContainer

    public LineSegmentContainer()

- ## Method Details

  - ### addIfNotContained

    public SegmentDirection addIfNotContained(LineSegment lineSegmentToAdd)
    Adds a line segment only if a line segment in the opposite direction (exchanged start and end points) not already exists in the container.
    Parameters:
      `lineSegmentToAdd` - the line segment to be added
    Returns:
      the dorection with which the segement further can be used. Forward if the segent has not yet existed or already exists in the same direction as the line segment to add. Reverse if the segment already exist in the opposite direction.

  - ### getReference

    public LineSegment getReference(LineSegment currentSegment)
    Returns the reference to the corresponding line segment in the container. If it has to be use forward or backwards tells the addIfNotContained() method. Can but does not have to be the same object as the currentSegment parameter.
    Parameters:
      `currentSegment` - segment of which a reference from the container is returned.
    Returns:
      the reference to the corresponding line segment in the container. If it has to be use forward or backwards tells the addIfNotContained() method. Can but does not have to be the same object as the currentSegment parameter.