Class Vec2
java.lang.Object
com.thingworx.types.primitives.structs.Vec2
- Direct Known Subclasses:
Vec3
BaseType used to represent a Vector of 2 decimal values modeled with x and y.
Default x value is 0.0.
Default y value is 0.0.
Default x value is 0.0.
Default y value is 0.0.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
int
static Vec2
fromString
(String value)
Construct a Vec2 from the provided string value.double
getX()
Get the x value.double
getY()
Get the y value.boolean
Check if this Vec2 instance is in its default state.void
setX
(double value)
Set the x value.void
setY
(double value)
Set the y value.toString()
Construct a string representation of this Vec2 instance.
-
Field Details
-
X
- See Also:
-
Y
- See Also:
-
-
Constructor Details
-
Vec2
public Vec2()
-
-
Method Details
-
getX
Get the x value.- Returns:
- The value of x
-
setX
Set the x value.- Parameters:
value
- - double value to be set for x
-
getY
Get the y value.- Returns:
- The value of y
-
setY
Set the y value.- Parameters:
value
- - double value to be set for y
-
compareTo
-
compare
-
toString
Construct a string representation of this Vec2 instance. -
isDefaultValue
Check if this Vec2 instance is in its default state.- Returns:
- true, when x equals 0.0 and y equals 0.0, false otherwise
-
fromString
Construct a Vec2 from the provided string value.- Parameters:
value
- - String to split by ',' then taking the first result as value for x and the second result as value for y- Returns:
- A new Vec2 from the string value
-