TransitVertex.java - Aster Execution Engine

Teradata Aster® Developer Guide

Product
Aster Execution Engine
Release Number
7.00.02
Published
July 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
xnl1494366523182.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
ffu1489104705746
lifecycle
previous
Product Category
Software

The TransitVertex class implements a vertex that represents a transit station.

import java.io.Serializable;

import com.asterdata.ncluster.graph.data.Vertex;
import com.asterdata.ncluster.graph.data.VertexKey;

/**
* Implements a vertex that represents a transit station.
*/
public class TransitVertex extends Vertex
implements Serializable
{
   // The city name.
   private String cityName = "notYetSet";

   // The default is recognizably unrealistic.
   public static final double DEFAULT_DISTANCE_ = Double.POSITIVE_INFINITY;
   // This holds the shortest distance from the source vertex that we have
   // found so far.
   private double distanceFromSource = DEFAULT_DISTANCE_;

   // Needed for serialization of Vertex.
   private static final long serialVersionUID = 1L;

   /**
   * Initialize vertex. Provides the superclass with the vertex key and type.
   *
   * @param vtxKey is the unique identifier for this vertex.
   * @param name is the city name, e.g. 'San Francisco'.
   */
   TransitVertex(VertexKey vtxKey, String name) {
      super(vtxKey);
      cityName = name;
   }

   // Returns the shortest distance from the source found so far.
   public double getDistanceFromSource() {
      return distanceFromSource;
   }

   // Set the shortest distance from the source found so far.
   public void setDistanceFromSource(double dist) {
      distanceFromSource = dist;
   }

   public String getCityName() {
      return cityName;
   }
} // Class TransitVertex