Package org.apache.batik.ext.awt.geom
Class PathLength.PathSegment
- java.lang.Object
-
- org.apache.batik.ext.awt.geom.PathLength.PathSegment
-
- Enclosing class:
- PathLength
protected static class PathLength.PathSegment extends java.lang.ObjectA single path segment in the flattened version of the path. This is a local helper class. PathSegment-objects are stored in thePathLength.segments- list. This is used as an immutable value-object.
-
-
Field Summary
Fields Modifier and Type Field Description protected intindexThe index of the original path segment this flattened segment is a part of.protected floatlengthThe length of the path segment, accumulated from the start.protected intsegTypeThe path segment type.protected floatxThe x coordinate of the path segment.protected floatyThe y coordinate of the path segment.
-
Constructor Summary
Constructors Constructor Description PathSegment(int segType, float x, float y, float len, int idx)Creates a new PathSegment with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIndex()Returns the segment index.floatgetLength()Returns the length of the path segment.intgetSegType()Returns the segment type.floatgetX()Returns the x coordinate of the path segment.floatgetY()Returns the y coordinate of the path segment.voidsetIndex(int v)Sets the segment index.voidsetLength(float v)Sets the length of the path segment.voidsetX(float v)Sets the x coordinate of the path segment.voidsetY(float v)Sets the y coordinate of the path segment.
-
-
-
Field Detail
-
segType
protected final int segType
The path segment type.
-
x
protected float x
The x coordinate of the path segment.
-
y
protected float y
The y coordinate of the path segment.
-
length
protected float length
The length of the path segment, accumulated from the start.
-
index
protected int index
The index of the original path segment this flattened segment is a part of.
-
-
Constructor Detail
-
PathSegment
PathSegment(int segType, float x, float y, float len, int idx)Creates a new PathSegment with the specified parameters.- Parameters:
segType- The segment typex- The x coordinatey- The y coordinatelen- The segment lengthidx- The index of the original path segment this flattened segment is a part of
-
-
Method Detail
-
getSegType
public int getSegType()
Returns the segment type.
-
getX
public float getX()
Returns the x coordinate of the path segment.
-
setX
public void setX(float v)
Sets the x coordinate of the path segment.
-
getY
public float getY()
Returns the y coordinate of the path segment.
-
setY
public void setY(float v)
Sets the y coordinate of the path segment.
-
getLength
public float getLength()
Returns the length of the path segment.
-
setLength
public void setLength(float v)
Sets the length of the path segment.
-
getIndex
public int getIndex()
Returns the segment index.
-
setIndex
public void setIndex(int v)
Sets the segment index.
-
-