This Java application simulates an email dashboard that tracks the duration of various operations performed on emails, such as reading, printing, and deleting. It generates a report displaying the durations of these operations in descending order.
- Tracks the duration between receiving an email and performing operations like reading, printing, and deleting.
- Generates a report displaying the durations of email operations in descending order.
- Supports mock data generation for testing purposes.
The main class that contains the main
method and the generateDashboard
method.
main
: Creates mock email data and calls thegenerateDashboard
method.generateDashboard
: Calculates the durations for email operations, sorts them in descending order, and prints the report.
A class representing the duration of an email operation (read, print, or delete).
operation
: The type of operation (read, print, or delete).duration
: The duration between receiving the email and performing the operation.
A class representing an email with various properties and methods.
sender
: The email address of the sender.recipient
: The email address of the recipient.subject
: The subject of the email.body
: The body content of the email.receivedTime
: The timestamp when the email was received.readTime
: The timestamp when the email was read.printedTime
: The timestamp when the email was printed.deletedTime
: The timestamp when the email was deleted.isRead
: A flag indicating if the email has been read.isPrinted
: A flag indicating if the email has been printed.isDeleted
: A flag indicating if the email has been deleted.markAsRead()
: Marks the email as read and sets thereadTime
.markAsPrinted()
: Marks the email as printed and sets theprintedTime
.markAsDeleted()
: Marks the email as deleted and sets thedeletedTime
.
- Clone the repository or download the source code.
- Compile the Java files using a Java compiler.
- Run the
EmailDashboard
class. - The application will generate mock email data and display the email operation durations report in the console.