Class SimulatedBallotCaster

All Implemented Interfaces:
Serializable, AutoCloseable, Actuator<String>, Device, Commented, ComprehensiveIdentification, Identified<Identification>, Named, BallotCaster

public class SimulatedBallotCaster extends AbstractSimulatedActuator<String> implements BallotCaster
Simulated ballot caster.
Since:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • SimulatedBallotCaster

      public SimulatedBallotCaster(String name)
  • Method Details

    • castBallot

      public void castBallot(String candidate)
      Description copied from interface: BallotCaster
      Casts a ballot for the specified candidate.
      Specified by:
      castBallot in interface BallotCaster
      Parameters:
      candidate - The candidate name or identifier.
    • getBallotCount

      public int getBallotCount()
      Specified by:
      getBallotCount in interface BallotCaster
      Returns:
      The total number of ballots cast through this component.
    • send

      public void send(String command) throws IOException
      Description copied from interface: Actuator
      Sends a command or value to the actuator.
      Specified by:
      send in interface Actuator<String>
      Parameters:
      command - the command/value to send
      Throws:
      IOException - if the operation fails