Package org.jf.util
Class TwoColumnOutput
java.lang.Object
org.jf.util.TwoColumnOutput
Class that takes a combined output destination and provides two
output writers, one of which ends up writing to the left column and
one which goes on the right.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTwoColumnOutput(OutputStream out, int leftWidth, int rightWidth, String spacer) Constructs an instance.TwoColumnOutput(Writer out, int leftWidth, int rightWidth, String spacer) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate static voidwriteSpaces(Writer out, int amt) Writes the given number of spaces to the given writer.
-
Field Details
-
out
non-null; underlying writer for final output -
leftWidth
private final int leftWidth> 0; the left column width -
rightWidth
private final int rightWidth -
spacer
-
leftLines
-
rightLines
-
-
Constructor Details
-
TwoColumnOutput
Constructs an instance.- Parameters:
out- non-null; writer to send final output toleftWidth- > 0; width of the left column, in charactersrightWidth- > 0; width of the right column, in charactersspacer- non-null; spacer string to sit between the two columns
-
TwoColumnOutput
Constructs an instance.- Parameters:
out- non-null; stream to send final output toleftWidth- >= 1; width of the left column, in charactersrightWidth- >= 1; width of the right column, in charactersspacer- non-null; spacer string to sit between the two columns
-
-
Method Details
-
write
- Throws:
IOException
-
writeSpaces
Writes the given number of spaces to the given writer.- Parameters:
out- non-null; where to writeamt- >= 0; the number of spaces to write- Throws:
IOException
-