Package de.uzl.its.swat.common
Class PrintBox
java.lang.Object
de.uzl.its.swat.common.PrintBox
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 Summary
ConstructorDescriptionPrintBox
(int boxSize) Constructs a PrintBox with a specified box size.Constructs a PrintBox with a specified box size and heading.Constructs a PrintBox with a specified box size, heading and some or all content. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a message to the box.getMsgs()
boolean
void
setContentPresent
(boolean contentPresent) void
setHeading
(String heading) void
toString()
Returns 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
Constructs a PrintBox with a specified box size and heading.- Parameters:
boxSize
- The size of the box.heading
- The heading of the box.
-
PrintBox
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
Adds a message to the box.- Parameters:
msg
- The message to add.
-
toString
Returns the box as a string. -
isContentPresent
public boolean isContentPresent() -
setContentPresent
public void setContentPresent(boolean contentPresent) -
getHeading
-
setHeading
-
getMsgs
-
setMsgs
-