com.supermap.data
Class PointM
- java.lang.Object
-
- com.supermap.data.PointM
-
public class PointM extends java.lang.ObjectThe PointM class. The precision is double.The pointM is the point with linear measure value. M indicates the measure value.
-
-
Constructor Summary
Constructors Constructor and Description PointM()Constructs a new PointM object.PointM(double x, double y, double m)Creates a new PointM object according to the specified arguments.PointM(PointM pointM)Constructs a new object identical to the given PointM object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description PointMclone()Returns a copy of the current PointM object.booleanequals(java.lang.Object obj)Specifies whether thisPointMstructure object has the same value, including X, Y and M, with the specified PointM object.static PointMgetEMPTY()Returns a nullPointMobject.doublegetM()Returns the measure value of the {PointM} structure object.doublegetX()Returns the X coordinate of the {PointM} structure object.doublegetY()Returns the Y coordinate of the {PointM} structure object.inthashCode()Gets the hash code of this PointM.booleanisEmpty()Returns a Boolean value that indicates whether this PointM is empty or not.voidsetM(double value)Sets the measure value of the {PointM} structure object.voidsetX(double value)Sets the X coordinate of the {PointM} structure object.voidsetY(double value)Sets the Y coordinate of the {PointM} structure object.java.lang.StringtoString()Creates a readable string indicates the structure object.
-
-
-
Constructor Detail
-
PointM
public PointM()
Constructs a new PointM object.
-
PointM
public PointM(double x, double y, double m)Creates a new PointM object according to the specified arguments.- Parameters:
x- The X coordinate of the PointM structure object.y- The X coordinate of the PointM structure object.m- The measure value of the PointM object.
-
PointM
public PointM(PointM pointM)
Constructs a new object identical to the given PointM object.- Parameters:
pointM- The specified PointM object.
-
-
Method Detail
-
getEMPTY
public static final PointM getEMPTY()
Returns a nullPointMobject. (That is X = Double.MIN_VALUE,Y = Double.MIN_VALUE,M = Double.MIN_VALUE)- Returns:
- an empty
PointMobject. - Example:
- The code below demonstrates how to create an empty PointM object.
public void getEMPTYTest(){ // Constructs an empty route point object PointM pointM2 = PointM.getEMPTY(); System.out.println(pointM2.isEmpty()); // true }
-
isEmpty
public boolean isEmpty()
Returns a Boolean value that indicates whether this PointM is empty or not.- Returns:
- a boolean, whether the object is null.
- Default:
- The default value is true.
-
getX
public double getX()
Returns the X coordinate of the {PointM} structure object.- Returns:
- The X coordinate of the
PointMstructure object. - Default:
- The default value is -1.7976931348623157e+308
-
setX
public void setX(double value)
Sets the X coordinate of the {PointM} structure object.- Parameters:
value- The X coordinate of thePointMstructure object.
-
getY
public double getY()
Returns the Y coordinate of the {PointM} structure object.- Returns:
- The Y coordinate of the
PointMstructure object. - Default:
- The default value is -1.7976931348623157e+308
-
setY
public void setY(double value)
Sets the Y coordinate of the {PointM} structure object.- Parameters:
value- The Y coordinate of thePointMstructure object.
-
getM
public double getM()
Returns the measure value of the {PointM} structure object.- Returns:
- The measure value of the
PointMstructure object. - Default:
- The default value is -1.7976931348623157e+308
-
setM
public void setM(double value)
Sets the measure value of the {PointM} structure object.- Parameters:
value- The measure value of thePointMstructure object.
-
clone
public PointM clone()
Returns a copy of the current PointM object.- Overrides:
clonein classjava.lang.Object- Returns:
- The new PointM object generated from the clone operation.
- Example:
- The following code demonstrates how to clone a PointM object and determines whether it is equal to the origin route point.
public void cloneTest(){ // Constructs a route point, M represents the measure value of routing point PointM pointM = new PointM(100, 100, 60); System.out.println(pointM); // {X=100.0,Y=100.0,M=60.0} // clone PointM pointM1 = (PointM) pointM.clone(); System.out.println(pointM1); // {X=100.0,Y=100.0,M=60.0} // Determines whether the cloned point is the same as the original routing point System.out.println(pointM.equals(pointM1)); // false }
-
equals
public boolean equals(java.lang.Object obj)
Specifies whether thisPointMstructure object has the same value, including X, Y and M, with the specified PointM object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the specifiedPointMobject.- Returns:
- true if the return values of the getX(), getY() and getM() of the given {
PointM} object equals the that of thisPointMobject. - Example:
- See the sample of
PointM.clone()method.
-
hashCode
public int hashCode()
Gets the hash code of this PointM.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code of this PointM object.
-
toString
public java.lang.String toString()
Creates a readable string indicates the structure object. For example, the object is PointM(2,3,4) , the corresponding string is "{X=2.0,Y=3.0,M=4.0}".- Overrides:
toStringin classjava.lang.Object- Returns:
- A readable string represent this
PointMstructure object.
-
-