/*
 * Trip.java
 *
 * Created on 28 novembre 2006, 15:39
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package com.developpez.dejardin.nodb;

import java.io.Serializable;
import java.util.Date;


/**
 *
 * @author valere dejardin
 */
public class Trip implements Comparable, Serializable {
    private int tripId;
    private int personId;
    private Date departureDate;
    private String fromCity;
    private String toCity;
    private String tripType;
    private String tripDesc;

    /**
     * Creates a new instance of Trip
     */
    public Trip() {        
    }

    /**
     * Creates a new instance of Trip
     */
    public Trip(int tripId, int personId, Date departureDate, String fromCity, String toCity, String tripType,
        String tripDesc) {
        this.tripId = tripId;
        this.personId = personId;
        this.departureDate = departureDate;
        this.fromCity = fromCity;
        this.toCity = toCity;
        this.tripType = tripType;
        this.tripDesc = tripDesc;
    }

    public int getTripId() {
        return tripId;
    }

    public void setTripId(int tripId) {
        this.tripId = tripId;
    }

    public int getPersonId() {
        return personId;
    }

    public void setPersonId(int personId) {
        this.personId = personId;
    }

    public Date getDepartureDate() {
        return departureDate;
    }

    public void setDepartureDate(Date departureDate) {
        this.departureDate = departureDate;
    }

    public String getFromCity() {
        return fromCity;
    }

    public void setFromCity(String fromCity) {
        this.fromCity = fromCity;
    }

    public String getToCity() {
        return toCity;
    }

    public void setToCity(String toCity) {
        this.toCity = toCity;
    }

    public String getTripType() {
        return tripType;
    }

    public void setTripType(String tripType) {
        this.tripType = tripType;
    }

    public String getTripDesc() {
        return tripDesc;
    }

    public void setTripDesc(String tripDesc) {
        this.tripDesc = tripDesc;
    }

    public int compareTo(Object o) {
        return compareTo((Trip) o);
    }

    public int compareTo(Trip trip) {
        return (this.departureDate).compareTo(trip.getDepartureDate());
    }
}
