TableFormatter

public class TableFormatter
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.TableFormatter


用于显示字符串元素矩阵的辅助类,以便每个元素列对齐

摘要

公共构造函数

TableFormatter()

公共方法

void displayTable(List<List<String>> table, PrintWriter writer)

以表格形式显示给定的字符串元素,并对齐列。

TableFormatter setColumnSpacing(int spacing)

设置每列之间的空白字符数。

公共构造函数

TableFormatter

public TableFormatter ()

公共方法

displayTable

public void displayTable (List<List<String>> table, 
                PrintWriter writer)

以表格形式显示给定的字符串元素,并对齐列。

参数
table List:一个包含 String 元素的矩阵。各行的长度可能有所不同

writer PrintWriter:要将输出转储到的 PrintWriter

setColumnSpacing

public TableFormatter setColumnSpacing (int spacing)

设置每列之间的空白字符数。

参数
spacing int:空白字符数

返回
TableFormatter TableFormatter