Class Vertex

java.lang.Object
llnl.gnem.core.polygon.Vertex
All Implemented Interfaces:
Serializable

public class Vertex extends Object implements Serializable
A class that encapsulates a 2-D point on the surface of the Earth described by a latitude and a longitude
Author:
Doug Dodge
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Vertex(double Lat, double Lon)
    Creates a new Vertex from a latitude and a longitude value
    Copy Constructor for the Vertex object
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determine whether two Vertex objects describe the same point.
    double
    Gets the lat attribute of the Vertex object
    double
    Gets the longitude of the Vertex
    int
    Return a unique hash code based on the latitude and longitude values
    void
    setLat(double Lat)
    Sets the latitude of the Vertex
    void
    setLon(double Lon)
    Sets the longitude of the Vertex
    Returns a String description of the Vertex.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Vertex

      public Vertex(double Lat, double Lon)
      Creates a new Vertex from a latitude and a longitude value
      Parameters:
      Lat - The latitude of the point
      Lon - The longitude of the point
    • Vertex

      public Vertex(Vertex v)
      Copy Constructor for the Vertex object
      Parameters:
      v - The Vertex to be copied
  • Method Details

    • getLat

      public double getLat()
      Gets the lat attribute of the Vertex object
      Returns:
      The lat value
    • getLon

      public double getLon()
      Gets the longitude of the Vertex
      Returns:
      The lon value
    • setLat

      public void setLat(double Lat)
      Sets the latitude of the Vertex
      Parameters:
      Lat - The new lat value
    • setLon

      public void setLon(double Lon)
      Sets the longitude of the Vertex
      Parameters:
      Lon - The new lon value
    • equals

      public boolean equals(Object o)
      Determine whether two Vertex objects describe the same point.
      Overrides:
      equals in class Object
      Parameters:
      o - The Vertex to be tested
      Returns:
      true if the two Vertex objects describe the same point.
    • hashCode

      public int hashCode()
      Return a unique hash code based on the latitude and longitude values
      Overrides:
      hashCode in class Object
      Returns:
      The hash code
    • toString

      public String toString()
      Returns a String description of the Vertex.
      Overrides:
      toString in class Object
      Returns:
      The String description.