org.eclipse.gef.geometry.planar

## Class Path.Segment

- java.lang.Object
- - org.eclipse.gef.geometry.planar.Path.Segment

Enclosing class:
  Path

    public static class Path.Segment
    extends Object

Representation for different types of `Path.Segment`s.

See Also:
  `MOVE_TO`, `LINE_TO`, `QUAD_TO`, `CUBIC_TO`

### Field Summary

Fields
`static int` `CLOSE` A `CLOSE` `Path.Segment` represents the link from the current position of a `Path` to the position of the last `MOVE_TO` `Path.Segment`.
`static int` `CUBIC_TO` A `CUBIC_TO` `Path.Segment` represents a `CubicCurve` from the previous position of a `Path` to the `Point` at index 2 associated with the `Path.Segment`.
`static int` `LINE_TO` A `LINE_TO` `Path.Segment` represents a `Line` from the previous position of a `Path` to the `Point` at index 0 associated with the `Path.Segment`.
`static int` `MOVE_TO` A `MOVE_TO` `Path.Segment` represents a change of position while piecewise building a `Path`, without inserting a new curve.
`static int` `QUAD_TO` A `QUAD_TO` `Path.Segment` represents a `QuadraticCurve` from the previous position of a `Path` to the `Point` at index 1 associated with the `Path.Segment`.

### Constructor Summary

Constructors
Constructor and Description
`Segment(int type, Point... points)` Constructs a new `Path.Segment` of the given type.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object obj)`
`Path.Segment` `getCopy()` Returns a copy of this `Path.Segment`.
`Point[]` `getPoints()` Returns a copy of the `Point`s associated with this `Path.Segment`.
`int` `getType()` Returns the type of this `Path.Segment`.
`int` `hashCode()`

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

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

### Field Detail

#### MOVE_TO

    public static final int MOVE_TO

A `MOVE_TO` `Path.Segment` represents a change of position while piecewise building a `Path`, without inserting a new curve.

See Also:
  `Path.moveTo(double, double)`, Constant Field Values

#### LINE_TO

    public static final int LINE_TO

A `LINE_TO` `Path.Segment` represents a `Line` from the previous position of a `Path` to the `Point` at index 0 associated with the `Path.Segment`.

See Also:
  `Path.lineTo(double, double)`, Constant Field Values

#### QUAD_TO

    public static final int QUAD_TO

A `QUAD_TO` `Path.Segment` represents a `QuadraticCurve` from the previous position of a `Path` to the `Point` at index 1 associated with the `Path.Segment`. The `Point` at index 0 is used as the handle `Point` of the `QuadraticCurve`.

See Also:
  `Path.quadTo(double, double, double, double)`, Constant Field Values

#### CUBIC_TO

    public static final int CUBIC_TO

A `CUBIC_TO` `Path.Segment` represents a `CubicCurve` from the previous position of a `Path` to the `Point` at index 2 associated with the `Path.Segment`. The `Point`s at indices 0 and 1 are used as the handle `Point`s of the `CubicCurve`.

See Also:
  `Path.cubicTo(double, double, double, double, double, double)`, Constant Field Values

#### CLOSE

    public static final int CLOSE

A `CLOSE` `Path.Segment` represents the link from the current position of a `Path` to the position of the last `MOVE_TO` `Path.Segment`.

See Also:
  `Path.close()`, Constant Field Values

### Constructor Detail

#### Segment

    public Segment(int type,
                   Point... points)

Constructs a new `Path.Segment` of the given type. The passed-in `Point`s are associated with this `Path.Segment`.

Parameters:
  `type` - The type of the new `Path.Segment`. It is one of
  - `MOVE_TO`
  - `LINE_TO`
  - `QUAD_TO`
  - `CUBIC_TO`
  `points` - the `Point`s to associate with this `Path.Segment`

### Method Detail

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### getCopy

    public Path.Segment getCopy()

Returns a copy of this `Path.Segment`. The associated `Point`s are copied, too.

Returns:
  a copy of this `Path.Segment`

#### getPoints

    public Point[] getPoints()

Returns a copy of the `Point`s associated with this `Path.Segment`.

Returns:
  a copy of the `Point`s associated with this `Path.Segment`.

#### getType

    public int getType()

Returns the type of this `Path.Segment`.

Returns:
  the type of this `Path.Segment`
See Also:
  `MOVE_TO`, `LINE_TO`, `QUAD_TO`, `CUBIC_TO`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`