org.opensha.sha.simulators.eqsim_v04
Class Vertex

java.lang.Object
  extended by org.opensha.commons.geo.Location
      extended by org.opensha.sha.simulators.eqsim_v04.Vertex
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Location>, XMLSaveable

public class Vertex
extends Location

This class represents a Vertex as defined by the EQSIM v04 specification, except that depth and distance along fault (DAS) here are in km rather than m. Depth is also positive here (but negative in the EQSIM specs). This uses "id" rather than "index" to avoid confusion from the fact that our indexing starts from zero (and that in EQSIM docs starts from 1)

Author:
field
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opensha.commons.geo.Location
XML_METADATA_DEPTH, XML_METADATA_LATITUDE, XML_METADATA_LONGITUDE, XML_METADATA_NAME
 
Constructor Summary
Vertex(double latitute, double longitude, double depth)
           
Vertex(double latitute, double longitude, double depth, int id)
           
Vertex(double latitute, double longitude, double depth, int id, double das, int traceFlag)
           
Vertex(Location loc)
           
Vertex(Location loc, int id, double das, int traceFlag)
          This constructor takes a location object
 
Method Summary
 boolean equals(Object obj)
           
 double getDAS()
          Note that DAS here is in km (whereas it's m in the EQSIM specs)
 int getID()
           
 double getLinearDistance(Location loc)
          This returns the linear distance (km) of this vertex to the given location
 int getTraceFlag()
          tells whether is on the fault trace (0 means no; 1 means yes, but not the first or last point; 2 means yes & it's the first; and 3 means yes & it's the last point)
 
Methods inherited from class org.opensha.commons.geo.Location
clone, compareTo, fromXMLMetadata, getDepth, getLatitude, getLatRad, getLongitude, getLonRad, hashCode, toKML, toString, toXMLMetadata
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vertex

public Vertex(double latitute,
              double longitude,
              double depth,
              int id,
              double das,
              int traceFlag)
Parameters:
latitute -
longitude -
depth - - in km as customary in OpenSHA (which is different from the EQSIM convention!)
id - - this is an integer ID for this vertex (referred to as "index" in EQSIM docs)
das - - distance along trace in km (km is different from EQSIM convention!)
traceFlag - - tells whether is on the fault trace (0 means no; 1 means yes, but not the first or last point; 2 means yes & it's the first; and 3 means yes & it's the last point)

Vertex

public Vertex(Location loc,
              int id,
              double das,
              int traceFlag)
This constructor takes a location object

Parameters:
loc -
id - - this is an integer ID for this vertex (referred to as "index" in EQSIM docs)
das - - distance along trace in km (km is different from EQSIM convention!)
traceFlag - - tells whether is on the fault trace (0 means no; 1 means yes, but not the first or last point; 2 means yes & it's the first; and 3 means yes & it's the last point)

Vertex

public Vertex(double latitute,
              double longitude,
              double depth)

Vertex

public Vertex(double latitute,
              double longitude,
              double depth,
              int id)

Vertex

public Vertex(Location loc)
Method Detail

getID

public int getID()

getDAS

public double getDAS()
Note that DAS here is in km (whereas it's m in the EQSIM specs)

Returns:

getTraceFlag

public int getTraceFlag()
tells whether is on the fault trace (0 means no; 1 means yes, but not the first or last point; 2 means yes & it's the first; and 3 means yes & it's the last point)

Returns:

getLinearDistance

public double getLinearDistance(Location loc)
This returns the linear distance (km) of this vertex to the given location

Parameters:
loc -
Returns:

equals

public boolean equals(Object obj)
Overrides:
equals in class Location