forked from nus-cs2113-AY2223S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from shengiv/branch-Modify-Flight-Details
Add modify flight details for both flight and passenger list
- Loading branch information
Showing
18 changed files
with
386 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="windows-1252" standalone="no"?> | ||
<!DOCTYPE log SYSTEM "logger.dtd"> | ||
<log> | ||
</log> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/seedu/duke/command/flightcommand/ModifyFlightNumCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package seedu.duke.command.flightcommand; | ||
|
||
import seedu.duke.command.Command; | ||
import seedu.duke.exceptions.SkyControlException; | ||
import seedu.duke.operationlist.OperationList; | ||
|
||
import java.io.IOException; | ||
import java.util.logging.Logger; | ||
import java.util.logging.LogManager; | ||
import java.util.logging.Level; | ||
import java.util.logging.ConsoleHandler; | ||
import java.util.logging.FileHandler; | ||
|
||
public class ModifyFlightNumCommand extends Command { | ||
private static final Logger LOGGER = Logger.getLogger(ModifyFlightNumCommand.class.getName()); | ||
|
||
public static void setupLogger() { | ||
LogManager.getLogManager().reset(); | ||
ModifyFlightNumCommand.LOGGER.setLevel(Level.ALL); | ||
ConsoleHandler consoleHandler = new ConsoleHandler(); | ||
consoleHandler.setLevel(Level.SEVERE); | ||
ModifyFlightNumCommand.LOGGER.addHandler(consoleHandler); | ||
createFileHandle(); | ||
ModifyFlightNumCommand.LOGGER.log(Level.INFO, ui.getLoggerStartUpMessage()); | ||
} | ||
|
||
private static void createFileHandle() { | ||
try { | ||
FileHandler fileHandler = new FileHandler("ModifyFlightNum-logger.log"); | ||
fileHandler.setLevel(Level.WARNING); | ||
ModifyFlightNumCommand.LOGGER.addHandler(fileHandler); | ||
} catch (IOException e) { | ||
ModifyFlightNumCommand.LOGGER.log(Level.SEVERE, ui.getLoggerError(), e); | ||
} | ||
} | ||
|
||
public void execute(OperationList entityList, String lineInput) throws SkyControlException { | ||
inputWords = lineInput.split("\\s+"); | ||
String flightNum = getFlightNumFromModifyCmd(inputWords); | ||
String newFlightNum = getModifiedDetail(inputWords); | ||
entityList.modifyFlightNum(flightNum, newFlightNum); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/seedu/duke/command/flightcommand/ModifyGateNumCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package seedu.duke.command.flightcommand; | ||
|
||
import seedu.duke.command.Command; | ||
import seedu.duke.exceptions.SkyControlException; | ||
import seedu.duke.operationlist.OperationList; | ||
|
||
import java.io.IOException; | ||
import java.util.logging.Logger; | ||
import java.util.logging.LogManager; | ||
import java.util.logging.Level; | ||
import java.util.logging.ConsoleHandler; | ||
import java.util.logging.FileHandler; | ||
|
||
public class ModifyGateNumCommand extends Command { | ||
private static final Logger LOGGER = Logger.getLogger(ModifyGateNumCommand.class.getName()); | ||
|
||
public static void setupLogger() { | ||
LogManager.getLogManager().reset(); | ||
ModifyGateNumCommand.LOGGER.setLevel(Level.ALL); | ||
ConsoleHandler consoleHandler = new ConsoleHandler(); | ||
consoleHandler.setLevel(Level.SEVERE); | ||
ModifyGateNumCommand.LOGGER.addHandler(consoleHandler); | ||
createFileHandle(); | ||
ModifyGateNumCommand.LOGGER.log(Level.INFO, ui.getLoggerStartUpMessage()); | ||
} | ||
|
||
private static void createFileHandle() { | ||
try { | ||
FileHandler fileHandler = new FileHandler("ModifyGateNum-logger.log"); | ||
fileHandler.setLevel(Level.WARNING); | ||
ModifyGateNumCommand.LOGGER.addHandler(fileHandler); | ||
} catch (IOException e) { | ||
ModifyGateNumCommand.LOGGER.log(Level.SEVERE, ui.getLoggerError(), e); | ||
} | ||
} | ||
|
||
public void execute(OperationList entityList, String lineInput) throws SkyControlException { | ||
inputWords = lineInput.split("\\s+"); | ||
String flightNum = getFlightNumFromModifyCmd(inputWords); | ||
String newGateNum = getModifiedDetail(inputWords); | ||
entityList.modifyGateNum(flightNum, newGateNum); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.