Class Cell.IllegalCharAddition

All Implemented Interfaces:
Serializable
Enclosing interface:
Cell

public static class Cell.IllegalCharAddition extends IllegalArgumentException
The IllegalCharAddition class is a specific type of IllegalArgumentException that is thrown when an invalid character is added to a cell. This exception indicates that the character being added does not meet the required criteria for the cell.

This class provides constructors to create an exception with a specific message, a cause, or both. It is designed to be used within the context of the Cell interface to enforce character validation rules.

Note to students: This is an inner class, which means it is defined within the Cell interface. An inner class is used here to logically group the exception with the interface it is related to. This helps keep the code organised and makes it clear that this exception is specifically related to operations involving Cell objects.

Since:
2024-07-05
Version:
1.0
See Also:
  • Constructor Details

    • IllegalCharAddition

      public IllegalCharAddition(String s)
      Constructs a new IllegalCharAddition with the specified detail message.
      Parameters:
      s - the detail message explaining the reason for the exception.
    • IllegalCharAddition

      public IllegalCharAddition(String message, Throwable cause)
      Constructs a new IllegalCharAddition with the specified detail message and cause.
      Parameters:
      message - the detail message explaining the reason for the exception.
      cause - the cause of the exception.
    • IllegalCharAddition

      public IllegalCharAddition(Throwable cause)
      Constructs a new IllegalCharAddition with the specified cause.
      Parameters:
      cause - the cause of the exception.