Class TwoColumnOutput
java.lang.Object
com.android.dx.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.
-
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
-
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
-
toString
Turns the given two strings (with widths) and spacer into a formatted two-column string.- Parameters:
s1-non-null;first stringwidth1-> 0;width of the first columnspacer-non-null;spacer strings2-non-null;second stringwidth2-> 0;width of the second column- Returns:
non-null;an appropriately-formatted string
-
getLeft
Gets the writer to use to write to the left column.- Returns:
non-null;the left column writer
-
getRight
Gets the writer to use to write to the right column.- Returns:
non-null;the right column writer
-
flush
public void flush()Flushes the output. If there are more lines of pending output in one column, then the other column will get filled with blank lines.
-