Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Train Dispatch System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johanne Fixdal
Train Dispatch System
Commits
b9486a75
Commit
b9486a75
authored
1 year ago
by
Johanne Fixdal
Browse files
Options
Downloads
Patches
Plain Diff
Updated imports
parent
8fa440ac
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/edu/ntnu/stud/UserInterface.java
+20
-14
20 additions, 14 deletions
src/main/java/edu/ntnu/stud/UserInterface.java
src/main/java/edu/ntnu/stud/commands/SetDelay.java
+1
-2
1 addition, 2 deletions
src/main/java/edu/ntnu/stud/commands/SetDelay.java
with
21 additions
and
16 deletions
src/main/java/edu/ntnu/stud/UserInterface.java
+
20
−
14
View file @
b9486a75
package
edu.ntnu.stud
;
import
edu.ntnu.stud.commands.*
;
import
java.time.LocalTime
;
import
edu.ntnu.stud.commands.Add
;
import
edu.ntnu.stud.commands.Command
;
import
edu.ntnu.stud.commands.Exit
;
import
edu.ntnu.stud.commands.Print
;
import
edu.ntnu.stud.commands.SearchDestination
;
import
edu.ntnu.stud.commands.SearchTrainN
;
import
edu.ntnu.stud.commands.SetDelay
;
import
edu.ntnu.stud.commands.SetTrack
;
import
java.util.Scanner
;
public
class
UserInterface
{
private
static
final
Command
[]
COMMANDS
=
{
...
...
@@ -17,7 +24,6 @@ public class UserInterface {
/**
* Handles user input by presenting a set of options and executing the selected command.
*
*/
public
static
void
start
(
Register
register
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/edu/ntnu/stud/commands/SetDelay.java
+
1
−
2
View file @
b9486a75
...
...
@@ -29,7 +29,7 @@ public class SetDelay extends Command {
if
(
trainDeparture
.
getTrainNumber
().
equals
(
chosenTrain
))
{
System
.
out
.
println
(
"If the train is delayed for more than an hour: press [1]"
+
"\n
i
f the train is delayed only for minutes: press [2]"
);
"\n
I
f the train is delayed only for minutes: press [2]"
);
switch
(
InputValidation
.
intProvider
())
{
case
1
:
int
hours
=
InputValidation
.
hoursProvider
();
...
...
@@ -44,7 +44,6 @@ public class SetDelay extends Command {
System
.
out
.
println
(
"Invalid choice. Please try again."
);
break
;
}
trainFound
=
true
;
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment