| | | 1 | | /** |
| | | 2 | | |
| | | 3 | | @file Calculator.java |
| | | 4 | | @brief This file serves as a demonstration file for the Calculator class. |
| | | 5 | | @details This file contains the implementation of the Calculator class, which provides various mathematical operations. |
| | | 6 | | */ |
| | | 7 | | |
| | | 8 | | /** |
| | | 9 | | |
| | | 10 | | @package com.ucoruh.calculator |
| | | 11 | | @brief The com.ucoruh.calculator package contains all the classes and files related to the Calculator App. |
| | | 12 | | */ |
| | | 13 | | package com.ucoruh.calculator; |
| | | 14 | | |
| | | 15 | | import org.slf4j.LoggerFactory; |
| | | 16 | | |
| | | 17 | | import ch.qos.logback.classic.Logger; |
| | | 18 | | /** |
| | | 19 | | |
| | | 20 | | @class Calculator |
| | | 21 | | @brief This class represents a Calculator that performs mathematical operations. |
| | | 22 | | @details The Calculator class provides methods to perform mathematical operations such as addition, subtraction, multipl |
| | | 23 | | @author ugur.coruh |
| | | 24 | | */ |
| | 1 | 25 | | public class Calculator { |
| | | 26 | | |
| | | 27 | | /** |
| | | 28 | | * @brief Logger for the Calculator class. |
| | | 29 | | */ |
| | 1 | 30 | | private static final Logger logger = (Logger) LoggerFactory.getLogger(Calculator.class); |
| | | 31 | | |
| | | 32 | | /** |
| | | 33 | | * @brief Calculates the sum of two integers. |
| | | 34 | | * |
| | | 35 | | * @details This function takes two integer values, `a` and `b`, and returns their sum. It also logs a message using t |
| | | 36 | | * |
| | | 37 | | * @param a The first integer value. |
| | | 38 | | * @param b The second integer value. |
| | | 39 | | * @return The sum of `a` and `b`. |
| | | 40 | | */ |
| | | 41 | | public int add(int a, int b) { |
| | | 42 | | // Logging an informational message |
| | 1 | 43 | | logger.info("Logging message"); |
| | | 44 | | // Logging an error message |
| | 1 | 45 | | logger.error("Error message"); |
| | | 46 | | // Returning the sum of `a` and `b` |
| | 1 | 47 | | return a + b; |
| | | 48 | | } |
| | | 49 | | } |