PathSegment


public final class PathSegment


A path segment represents a curve (line, cubic, quadratic or conic) or a command inside a fully formed path object.

A segment is identified by a type which in turns defines how many points are available (from 0 to 3) and whether the weight is meaningful. Please refer to the documentation of each type for more information.

A segment with the Move or Close is usually represented by the singletons DoneSegment and CloseSegment respectively.

Summary

Nested types

public enum PathSegment.Type extends Enum

Type of a given segment in a path, either a command (Type.Move, Type.Close, Type.Done) or a curve (Type.Line, Type.Cubic, Type.Quadratic, Type.Conic).

Public methods

boolean
equals(Object other)
final @NonNull PointF[]

An array of points describing this segment, whose size depends on type.

final @NonNull PathSegment.Type

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

final float

Conic weight, only valid if type is Type.Conic.

int
@NonNull String

Public methods

equals

public boolean equals(Object other)

getPoints

Added in 1.0.0
public final @NonNull PointF[] getPoints()

An array of points describing this segment, whose size depends on type.

getType

Added in 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
public final float getWeight()

Conic weight, only valid if type is Type.Conic.

hashCode

public int hashCode()

toString

public @NonNull String toString()