Class Step

  • All Implemented Interfaces:
    java.lang.Cloneable, java.util.Iterator<Step>

    public class Step
    extends java.lang.Object
    implements java.util.Iterator<Step>, java.lang.Cloneable
    Represent an step : an airport and a duration from first take off
    • Constructor Summary

      Constructors 
      Constructor Description
      Step​(Airport airport, java.time.Duration duration)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Redefinition of clone
      Airport getAirport()
      Getter
      java.time.Duration getDuration()
      Getter
      boolean hasNext()
      Getter, implementation of iterator
      Step next()
      Getter, implementation of iterator
      java.lang.String toString()
      Redefinition of toString
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • Step

        public Step​(Airport airport,
                    java.time.Duration duration)
        Constructor
        Parameters:
        airport - an airport
        duration - the step duration
        Throws:
        java.lang.IllegalArgumentException - on null parameter
    • Method Detail

      • getDuration

        public java.time.Duration getDuration()
        Getter
        Returns:
        step duration
      • getAirport

        public Airport getAirport()
        Getter
        Returns:
        step airport
      • next

        public Step next()
        Getter, implementation of iterator
        Specified by:
        next in interface java.util.Iterator<Step>
        Returns:
        next step
      • hasNext

        public boolean hasNext()
        Getter, implementation of iterator
        Specified by:
        hasNext in interface java.util.Iterator<Step>
        Returns:
        if next step exist
      • clone

        public java.lang.Object clone()
        Redefinition of clone
        Overrides:
        clone in class java.lang.Object
        Returns:
        new step with same attributes
      • toString

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