Package com.uca.flights
Class Trip
- java.lang.Object
-
- com.uca.flights.Trip
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Trip extends java.lang.Object implements java.lang.CloneableRepresent an trip, several jumps
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Redefinition of clone, return clone or this depending on modifiablevoiddelay(java.time.Duration d)Delay the duration from another durationvoiddelay(java.time.Duration d, Jump j)Delay the duration from another duration from a specific jumpvoiddelay(java.time.Duration d, Step s)Delay the duration from another duration from a specific stepjava.lang.StringtoString()Redefinition of toString
-
-
-
Constructor Detail
-
Trip
public Trip(Jump j, boolean modifiable)
Constructor- Parameters:
j- a jumpmodifiable- 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:
clonein classjava.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 durationj- 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 durations- the step- Throws:
java.lang.IllegalArgumentException- on null parameter
-
toString
public java.lang.String toString()
Redefinition of toString- Overrides:
toStringin classjava.lang.Object- Returns:
- a string with starting and last airport and duration in hours
-
-