Package com.uca.flights
Class Step
- java.lang.Object
-
- com.uca.flights.Step
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Redefinition of cloneAirportgetAirport()Getterjava.time.DurationgetDuration()GetterbooleanhasNext()Getter, implementation of iteratorStepnext()Getter, implementation of iteratorjava.lang.StringtoString()Redefinition of toString
-
-
-
Constructor Detail
-
Step
public Step(Airport airport, java.time.Duration duration)
Constructor- Parameters:
airport- an airportduration- 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:
nextin interfacejava.util.Iterator<Step>- Returns:
- next step
-
hasNext
public boolean hasNext()
Getter, implementation of iterator- Specified by:
hasNextin interfacejava.util.Iterator<Step>- Returns:
- if next step exist
-
clone
public java.lang.Object clone()
Redefinition of clone- Overrides:
clonein classjava.lang.Object- Returns:
- new step with same attributes
-
toString
public java.lang.String toString()
Redefinition of toString- Overrides:
toStringin classjava.lang.Object- Returns:
- a string with airport and duration in hours
-
-