com.c5corp.c5gps
Class Route

java.lang.Object
  extended by com.c5corp.c5gps.GpsType
      extended by com.c5corp.c5gps.GpsPointCollection
          extended by com.c5corp.c5gps.Route
All Implemented Interfaces:
java.util.Enumeration

public class Route
extends GpsPointCollection

A Route is a container class for a list of RoutePoint objects. A list of RoutePoints is typically stored in a file; this object represents such a file. The file has header data that applies to all of the RoutePoints it contains, but for RoutePoints this data is added as local fields to individual RoutePoint objects. These lists are conceptually "ordered" data. Another important matter to note is that all of the C5UTM GpsDataFileType classes and the data classes they encapsulate are intended for use with a relational database application. There are fields in typical GPS data that are ignored by these classes, and often, floating point type numbers are rounded to intergers.

Since:
2.0
Author:
Brett Stalbaum Copyright 2002-2006 see LICENSE.txt and UCSD_LICENSE.txt
See Also:
RoutePoint, CsvRouteListFilter

Field Summary
 
Fields inherited from class com.c5corp.c5gps.GpsType
hdatum
 
Constructor Summary
Route(java.util.Vector<RoutePoint> routePoints, java.lang.String name)
           
 
Method Summary
 boolean equals(Route route)
          Compares the another Route to this to see if they are equivalent.
 Route getCopy()
          Returns a Route object that is a copy of this
 java.lang.String getRouteName()
          returns the name of this route
 boolean hasMoreElements()
          implements java.util.Enumeration
 RoutePoint nextElement()
          implements java.util.Enumeration
 void reset()
          resets the java.util.Enumeration to the first element
 int size()
          returns the number of elements (RoutePoints) in this Route.
 java.lang.String toString()
          override toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Route

public Route(java.util.Vector<RoutePoint> routePoints,
             java.lang.String name)
Parameters:
routePoints - a Vector of RoutePoint objects
name - the name of the Route
Method Detail

hasMoreElements

public boolean hasMoreElements()
implements java.util.Enumeration

Returns:
true if has more elements
See Also:
Enumeration

nextElement

public RoutePoint nextElement()
                       throws java.util.NoSuchElementException
implements java.util.Enumeration

Returns:
the next RoutePoint
Throws:
java.util.NoSuchElementException
See Also:
Enumeration

reset

public void reset()
resets the java.util.Enumeration to the first element


getRouteName

public java.lang.String getRouteName()
returns the name of this route

Returns:
the route name, which is derived from its RoutePoints

size

public int size()
returns the number of elements (RoutePoints) in this Route.

Returns:
the number of route points in this object

equals

public boolean equals(Route route)
Compares the another Route to this to see if they are equivalent. The number of RoutePoints must be the same, and each routepoint must contain the same planametric coordinates.

Parameters:
route - the Route to compare
Returns:
true if the routes are equal

getCopy

public Route getCopy()
Returns a Route object that is a copy of this

Returns:
a Route object that is a copy of this

toString

public java.lang.String toString()

override toString()

Overrides:
toString in class java.lang.Object