Top Description Fields Constructors Methods
org.apache.pdfbox.util

public final Class Vector

extends Object
Class Inheritance

A 2D vector.
Author
John Hewson

Field Summary

Modifier and TypeField and Description
private final float
x

private final float
y

Constructor Summary

AccessConstructor and Description
public
Vector(float x, float y)

Method Summary

Modifier and TypeMethod and Description
public float

Returns:

the x magnitude
getX
()

Returns the x magnitude.

public float

Returns:

the y magnitude
getY
()

Returns the y magnitude.

public Vector

Returns:

a new vector scaled by both x and y
scale
(float
x and y scale
sxy
)

Returns a new vector scaled by both x and y.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

xback to summary
private final float x
yback to summary
private final float y

Constructor Detail

Vectorback to summary
public Vector(float x, float y)

Method Detail

getXback to summary
public float getX()

Returns the x magnitude.

Returns:float

the x magnitude

getYback to summary
public float getY()

Returns the y magnitude.

Returns:float

the y magnitude

scaleback to summary
public Vector scale(float sxy)

Returns a new vector scaled by both x and y.

Parameters
sxy:float

x and y scale

Returns:Vector

a new vector scaled by both x and y

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override