Class Trip

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class Trip
    extends java.lang.Object
    implements java.lang.Cloneable
    Represent an trip, several jumps
    • Constructor Summary

      Constructors 
      Constructor Description
      Trip​(Jump j)
      Constructor
      Trip​(Jump j, boolean modifiable)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Redefinition of clone, return clone or this depending on modifiable
      void delay​(java.time.Duration d)
      Delay the duration from another duration
      void delay​(java.time.Duration d, Jump j)
      Delay the duration from another duration from a specific jump
      void delay​(java.time.Duration d, Step s)
      Delay the duration from another duration from a specific step
      java.lang.String toString()
      Redefinition of toString
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Trip

        public Trip​(Jump j,
                    boolean modifiable)
        Constructor
        Parameters:
        j - a jump
        modifiable - if trip is modifiable
        Throws:
        java.lang.IllegalArgumentException - on null parameter
      • Trip

        public Trip​(Jump j)
        Constructor
        Parameters:
        j - a jump
        Throws:
        java.lang.IllegalArgumentException - on null parameter
    • Method Detail

      • clone

        public java.lang.Object clone()
        Redefinition of clone, return clone or this depending on modifiable
        Overrides:
        clone in class java.lang.Object
        Returns:
        new step with same attributes
      • delay

        public void delay​(java.time.Duration d)
        Delay the duration from another duration
        Parameters:
        d - the duration
        Throws:
        java.lang.IllegalArgumentException - on null parameter
      • delay

        public void delay​(java.time.Duration d,
                          Jump j)
        Delay the duration from another duration from a specific jump
        Parameters:
        d - the duration
        j - the jump
        Throws:
        java.lang.IllegalArgumentException - on null parameter
      • delay

        public void delay​(java.time.Duration d,
                          Step s)
        Delay the duration from another duration from a specific step
        Parameters:
        d - the duration
        s - the step
        Throws:
        java.lang.IllegalArgumentException - on null parameter
      • toString

        public java.lang.String toString()
        Redefinition of toString
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string with starting and last airport and duration in hours