# PathSegment

Artifact: [androidx.graphics:graphics-path](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/path/PathSegment.kt+class:androidx.graphics.path.PathSegment) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

*** ** * ** ***


```
public final class PathSegment
```

<br />

*** ** * ** ***

A path segment represents a curve (line, cubic, quadratic or conic) or a command inside a fully formed `https://developer.android.com/reference/android/graphics/Path.html` object.

A segment is identified by a `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type` which in turns defines how many `https://developer.android.com/reference/androidx/graphics/path/PathSegment#points()` are available (from 0 to 3) and whether the `https://developer.android.com/reference/androidx/graphics/path/PathSegment#weight()` is meaningful. Please refer to the documentation of each `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type` for more information.

A segment with the `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Move` or `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Close` is usually represented by the singletons `https://developer.android.com/reference/androidx/graphics/path/package-summary#DoneSegment()` and `https://developer.android.com/reference/androidx/graphics/path/package-summary#CloseSegment()` respectively.

## Summary

| ### Nested types |
|---|
| `public enum https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type extends https://developer.android.com/reference/java/lang/Enum.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type>` Type of a given segment in a `https://developer.android.com/reference/android/graphics/Path.html`, either a command (`https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Move`, `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Close`, `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Done`) or a curve (`https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Line`, `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Cubic`, `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Quadratic`, `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Conic`). |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/graphics/path/PathSegment#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull PointF[]` | `https://developer.android.com/reference/androidx/graphics/path/PathSegment#getPoints()()` An array of points describing this segment, whose size depends on `https://developer.android.com/reference/androidx/graphics/path/PathSegment#type()`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type` | `https://developer.android.com/reference/androidx/graphics/path/PathSegment#getType()()` The type that identifies this segment and defines the number of points. |
| `final float` | `https://developer.android.com/reference/androidx/graphics/path/PathSegment#getWeight()()` Conic weight, only valid if `https://developer.android.com/reference/androidx/graphics/path/PathSegment#type()` is `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Conic`. |
| `int` | `https://developer.android.com/reference/androidx/graphics/path/PathSegment#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/graphics/path/PathSegment#toString()()` |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getPoints

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public final @NonNull PointF[] getPoints()
```

An array of points describing this segment, whose size depends on `https://developer.android.com/reference/androidx/graphics/path/PathSegment#type()`.

### getType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public final @NonNull PathSegment.Type getType()
```

The type that identifies this segment and defines the number of points.

### getWeight

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public final float getWeight()
```

Conic weight, only valid if `https://developer.android.com/reference/androidx/graphics/path/PathSegment#type()` is `https://developer.android.com/reference/androidx/graphics/path/PathSegment.Type#Conic`.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```