Interface Trip

  • All Superinterfaces:
    android.os.Parcelable

    public interface Trip
    extends android.os.Parcelable
    This interface to represent Trip. A trip is a collection of legs that belong to the same journey (i.e., the stationary periods are relatively short).
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T extends java.lang.Object>, android.os.Parcelable.Creator<T extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Trip EMPTY  
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Field Detail

      • EMPTY

        static final Trip EMPTY
    • Method Detail

      • getTimestampStart

        long getTimestampStart()
        Returns:
        the UTC timestamp (in ms) of the start of the TMD trip
      • getTimestampEnd

        long getTimestampEnd()
        Returns:
        the UTC timestamp (in ms) of the end of the TMD trip
      • getDuration

        double getDuration()
        Returns:
        the duration in seconds of the trip
      • hasLegs

        boolean hasLegs()
        Check whether the trip has legs
        Returns:
        true if the trip has legs, false otherwise
      • size

        int size()
        The size of the trip
        Returns:
        the number of legs in the trip
      • getLegs

        java.util.List<TmdActivity> getLegs()
        Get the list of legs for this trip
        Returns:
        the list of legs for this trip
      • getMainMode

        java.lang.String getMainMode()
        Returns:
        the main mode of the trip
      • getDistance

        double getDistance()
        The distance of the trip in meters
        Returns:
        the distance of the trip
      • getCo2

        double getCo2()
        The co2 produced during this trip
        Returns:
        the co2 produced in grams
      • getOrigin

        java.lang.String getOrigin()
        The name of the origin for the trip
        Returns:
        the origin of the trip
      • getDestination

        java.lang.String getDestination()
        The destination of the trip
        Returns:
        the destination
      • getReason

        @Deprecated
        java.lang.String getReason()
        Deprecated.
        use instead @link{getPurpose}
        The reason for the trip
        Returns:
        the reason for the trip
      • getPurpose

        java.lang.String getPurpose()
        The purpose for the trip
        Returns:
        the purpose for the trip
      • getReasons

        java.lang.String[] getReasons()
        The reasoning for this trip
        Returns:
        the list of reason for combining these modes
      • getMetadata

        java.lang.String getMetadata()
        The metadata for the trip
        Returns:
        the metadata for the trip
      • isValidated

        boolean isValidated()
        This field is important for reporting
        Returns:
        true if the trip has been validated by the user
      • isCompleted

        boolean isCompleted()
        This fields tells if the trip is completed and thus, may be not be modified without the user's input
        Returns:
        true if the trip is completed.
      • sameTrip

        static boolean sameTrip​(@NonNull
                                Trip first,
                                @NonNull
                                Trip second)
      • sameTrips

        static boolean sameTrips​(@NonNull
                                 java.util.List<Trip> first,
                                 @NonNull
                                 java.util.List<Trip> second)
      • unmarshall

        static Trip unmarshall​(java.lang.String trip)
      • marshall

        static java.lang.String marshall​(Trip trip)