Class Hide

java.lang.Object
ch.heigvd.dai.commands.Hide
All Implemented Interfaces:
Callable<Integer>

public class Hide extends Object implements Callable<Integer>
Implements the hide subcommand for executing the program on a CLI.

This class defines the parameters and options that are only specific for this subcommand. For checking the usage of the subcommand, use the --help option.

Author:
Pedro Alves da Silva, Gonçalo Carvalheiro Heleno
  • Field Details

    • parent

      private Root parent
    • filenameOutput

      private String filenameOutput
    • bitsPerByte

      private int bitsPerByte
  • Constructor Details

    • Hide

      public Hide()
  • Method Details

    • call

      public Integer call()
      Call function that contains the logic of the subcommand.

      This function performs the multiple input validation checks and outputs an exit code accordingly. An error message is displayed to explain why the command failed.

      Specified by:
      call in interface Callable<Integer>
      Returns:
      exit code 1 if there was an error, 0 otherwise
    • isPowerOfTwo

      private boolean isPowerOfTwo(int n)