Class PrintBox

java.lang.Object
de.uzl.its.swat.common.PrintBox

public class PrintBox extends Object
This class represents a utility for printing messages inside a box structure. The box has a dynamic size based on the content and can include a heading. Using the .toString() method will return the box as a string.
  • Constructor Details

    • PrintBox

      public PrintBox(int boxSize)
      Constructs a PrintBox with a specified box size.
      Parameters:
      boxSize - The size of the box.
    • PrintBox

      public PrintBox(int boxSize, String heading)
      Constructs a PrintBox with a specified box size and heading.
      Parameters:
      boxSize - The size of the box.
      heading - The heading of the box.
    • PrintBox

      public PrintBox(int boxSize, String heading, ArrayList<String> msgs)
      Constructs a PrintBox with a specified box size, heading and some or all content.
      Parameters:
      boxSize - The size of the box.
      heading - The heading of the box.
      msgs - The content of the box.
  • Method Details

    • addMsg

      public void addMsg(String msg)
      Adds a message to the box.
      Parameters:
      msg - The message to add.
    • toString

      public String toString()
      Returns the box as a string.
      Overrides:
      toString in class Object
      Returns:
      The box as a string.
    • isContentPresent

      public boolean isContentPresent()
    • setContentPresent

      public void setContentPresent(boolean contentPresent)
    • getHeading

      public String getHeading()
    • setHeading

      public void setHeading(String heading)
    • getMsgs

      public ArrayList<String> getMsgs()
    • setMsgs

      public void setMsgs(ArrayList<String> msgs)