/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package feedback.server;

/**
 *
 * @author callum
 */

/**
 * Stores the number of responses for 3 options (A, B, C).
 */
public class FeedbackCounter {
    private int countA = 0;
    private int countB = 0;
    private int countC = 0;

    /**
     * Increments the count for the selected option ('A', 'B', or 'C').
     */
    public synchronized void increment(char option) {
        switch (Character.toUpperCase(option)) {
            case 'A' -> countA++;
            case 'B' -> countB++;
            case 'C' -> countC++;
        }
    }

    /**
     * Returns the current counts for options A, B, and C.
     */
    public synchronized int[] getCounts() {
        return new int[]{countA, countB, countC};
    }
}
