me.himanshusoni.gpxparser.modal.Route Maven / Gradle / Ivy
package me.himanshusoni.gpxparser.modal;
import java.util.ArrayList;
import java.util.HashSet;
public class Route extends Extension {
private String name;
private String comment;
private String description;
private String src;
private HashSet links;
private int number;
private String type;
private ArrayList routePoints;
/**
* Returns the name of this route.
*
* @return A String representing the name of this route.
*/
public String getName() {
return name;
}
/**
* Setter for route name property. This maps to <name> tag value.
*
* @param name A String representing the name of this route.
*/
public void setName(String name) {
this.name = name;
}
/**
* Returns the comment of this route.
*
* @return A String representing the comment of this route.
*/
public String getComment() {
return comment;
}
/**
* Setter for route comment property. This maps to <comment> tag value.
*
* @param comment A String representing the comment of this route.
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
* Returns the description of this route.
*
* @return A String representing the description of this route.
*/
public String getDescription() {
return description;
}
/**
* Setter for route description property. This maps to <description> tag value.
*
* @param description A String representing the description of this route.
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Returns the src of this route.
*
* @return A String representing the src of this route.
*/
public String getSrc() {
return src;
}
/**
* Setter for src type property. This maps to <src> tag value.
*
* @param src A String representing the src of this route.
*/
public void setSrc(String src) {
this.src = src;
}
/**
* Returns the number of this route.
*
* @return A String representing the number of this route.
*/
public Integer getNumber() {
return number;
}
/**
* Setter for route number property. This maps to <number> tag value.
*
* @param number An Integer representing the number of this route.
*/
public void setNumber(Integer number) {
this.number = number;
}
/**
* Returns the type of this route.
*
* @return A String representing the type of this route.
*/
public String getType() {
return type;
}
/**
* Setter for route type property. This maps to <type> tag value.
*
* @param type A String representing the type of this route.
*/
public void setType(String type) {
this.type = type;
}
/**
* Getter for the list of waypoints of this route.
*
* @return an ArrayList of {@link Waypoint} representing the points of the route.
*/
public ArrayList getRoutePoints() {
return routePoints;
}
/**
* Setter for the list of waypoints of this route.
*
* @param routePoints an ArrayList of {@link Waypoint} representing the points of the route.
*/
public void setRoutePoints(ArrayList routePoints) {
this.routePoints = routePoints;
}
/**
* Adds this new waypoint to this route.
*
* @param waypoint a {@link Waypoint}.
*/
public void addRoutePoint(Waypoint waypoint) {
if (routePoints == null) {
routePoints = new ArrayList();
}
routePoints.add(waypoint);
}
public HashSet getLinks() {
return links;
}
public void setLinks(HashSet links) {
this.links = links;
}
public void addLink(Link link) {
if (links == null) {
links = new HashSet<>();
}
links.add(link);
}
/**
* Returns a String representation of this track.
*/
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("rte[");
sb.append("name:" + name + " ");
int points = 0;
if (routePoints != null) {
points = routePoints.size();
}
sb.append("rtepts:" + points + " ");
sb.append("]");
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy