-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix checkstyle and add javadoc to certain model classes
- Loading branch information
Showing
5 changed files
with
131 additions
and
49 deletions.
There are no files selected for viewing
23 changes: 15 additions & 8 deletions
23
src/main/java/edu/ntnu/idi/idatt2003/gruppe42/model/exceptions/StockFileParseException.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 |
|---|---|---|
| @@ -1,15 +1,22 @@ | ||
| package edu.ntnu.idi.idatt2003.gruppe42.model.exceptions; | ||
|
|
||
| /** | ||
| * Exception thrown when an error occurs while parsing a stock file. | ||
| * | ||
| * <p>This exception includes information about the line number and the content | ||
| * of the line where the parsing error occurred. | ||
| */ | ||
| public class StockFileParseException extends Exception { | ||
| private final int lineNumber; | ||
| private final String lineContent; | ||
|
|
||
| /** | ||
| * Creates a new StockFileParseException with details about the parsing error. | ||
| * | ||
| * @param lineNumber the line number where the error occurred | ||
| * @param lineContent the content of the line that caused the error | ||
| * @param reason a description of why the parsing failed | ||
| */ | ||
| public StockFileParseException(int lineNumber, String lineContent, String reason) { | ||
| super(String.format("Parse error on line %d: %s%n Content : \"%s\"", lineNumber, reason, lineContent)); | ||
| this.lineNumber = lineNumber; | ||
| this.lineContent = lineContent; | ||
| super(String.format("Parse error on line %d: %s%n Content : \"%s\"", | ||
| lineNumber, reason, lineContent)); | ||
| } | ||
|
|
||
| public int getLineNumber() { return lineNumber; } | ||
| public String getLineContent() { return lineContent; } | ||
| } |
29 changes: 23 additions & 6 deletions
29
src/main/java/edu/ntnu/idi/idatt2003/gruppe42/model/transaction/Purchase.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
27 changes: 22 additions & 5 deletions
27
src/main/java/edu/ntnu/idi/idatt2003/gruppe42/model/transaction/Sale.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
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