public class WOWZPoint extends java.lang.Object implements java.lang.Comparable<WOWZPoint>, java.io.Serializable
WOWZPoint pt1 = new WOWZPoint(200, 300);
WOWZPoint pt2 = new WOWZPoint(287, 543);
double distanceApart = pt1.distanceTo(pt2);
Modifier and Type | Field and Description |
---|---|
int |
x
The x coordinate of the point.
|
int |
y
The y coordinate of the point.
|
Constructor and Description |
---|
WOWZPoint()
The default constructor.
|
WOWZPoint(int x,
int y)
Creates and intitalizes an instance using the specified property values.
|
WOWZPoint(WOWZPoint other)
Creates and intitalizes an instance using the property values from the specified instance.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(int x,
int y)
Compares this property values of this instance with the specified values.
|
int |
compareTo(WOWZPoint other)
Compares this instance with the specified instance.
|
static double |
distance(int x1,
int y1,
int x2,
int y2)
Calculates the distance between two points.
|
double |
distanceTo(int x,
int y)
Calculates the distance between this point and the specified values.
|
double |
distanceTo(WOWZPoint other)
Calculates the distance between this point and the specified instance.
|
boolean |
equals(int x,
int y)
Compares the property values of this instance with the specified values for equality.
|
boolean |
equals(int x1,
int y1,
int x2,
int y2)
Compares two points for equality.
|
boolean |
equals(java.lang.Object other)
Compares this instance with the specified instance for equality.
|
int |
getX() |
int |
getY() |
void |
invert()
Inverts the coordinate values of this instance.
|
WOWZPoint |
inverted()
Creates a version of this instance with the coordinate values reversed.
|
static java.lang.String |
label(int x,
int y)
Gets a human-readable description of the specified values.
|
void |
set(int x,
int y)
Updates the property values of this instance with the specified values.
|
void |
set(WOWZPoint other)
Updates the property values of this instance with the property values from the specified instance.
|
void |
setX(int x)
Updates the x coordinate property value.
|
void |
setY(int y)
Updates the y coordinate property value.
|
java.lang.String |
toString()
Gets a human-readable description of this instance.
|
public int x
public int y
public WOWZPoint()
public WOWZPoint(int x, int y)
x
- The value of the x coordinate.y
- The value of the y coordinate.public WOWZPoint(WOWZPoint other)
other
- The instance to use.public boolean equals(int x1, int y1, int x2, int y2)
x1
- The x coordinate of the first point.y1
- The y coordinate of the first point.x2
- The x coordinate of the second point.y2
- The y coordinate of the second point.public static double distance(int x1, int y1, int x2, int y2)
x1
- The x coordinate of the first point.y1
- The y coordinate of the first point.x2
- The x coordinate of the second point.y2
- The y coordinate of the second point.public static java.lang.String label(int x, int y)
public int getX()
public void setX(int x)
x
- The value of the x coordinate.public int getY()
public void setY(int y)
y
- The value of the y coordinate.public void set(int x, int y)
x
- The value of the x coordinate.y
- The value of the y coordinate.public void set(WOWZPoint other)
other
- The instance with the property values to use.public boolean equals(int x, int y)
x
- The value of the x coordinate.y
- The value of the y coordinate.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The instance to use for comparison.public int compareTo(int x, int y)
x
- The value of the x coordinate.y
- The value of the y coordinate.public int compareTo(WOWZPoint other)
compareTo
in interface java.lang.Comparable<WOWZPoint>
other
- The instance to use for comparison.public java.lang.String toString()
toString
in class java.lang.Object
public WOWZPoint inverted()
public void invert()
public double distanceTo(int x, int y)
x
- The value of the x coordinate.y
- The value of the y coordinate.public double distanceTo(WOWZPoint other)
other
- The instance to use for the calculation.© 2016 - 2018 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal