Package edu.cmu.tetrad.util
Class TextTable
java.lang.Object
edu.cmu.tetrad.util.TextTable
Stores a 2D array of Strings for printing out tables. The table can print out
 columns either left justified or right justified, with a given number of
 spaces between columns.
- Author:
- Joseph Ramsey
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intSetjustificationto this if the columns should be left justified.static final intSetjustificationto this if the columns should be right justified.
- 
Constructor SummaryConstructorsConstructorDescriptionTextTable(int rows, int columns) Construct the text table; the table has a fixed number of rows and columns, each greater than zero.
- 
Method SummaryModifier and TypeMethodDescriptionintintgetTokenAt(int row, int column) voidsetColumnSpacing(int numSpaces) Sets the number of spaces between columns, to some number >= 0.voidsetDelimiter(TextTable.Delimiter delimiter) voidsetJustification(int justification) Sets the justification, either LEFT_JUSTIFIED or RIGHT_JUSTIFIED.voidSets the token at the given row and column, each of which must be >= 0 and less than the number of rows or columns, respectively.toString()
- 
Field Details- 
LEFT_JUSTIFIEDpublic static final int LEFT_JUSTIFIEDSetjustificationto this if the columns should be left justified.- See Also:
 
- 
RIGHT_JUSTIFIEDpublic static final int RIGHT_JUSTIFIEDSetjustificationto this if the columns should be right justified.- See Also:
 
 
- 
- 
Constructor Details- 
TextTablepublic TextTable(int rows, int columns) Construct the text table; the table has a fixed number of rows and columns, each greater than zero.
 
- 
- 
Method Details- 
setTokenSets the token at the given row and column, each of which must be >= 0 and less than the number of rows or columns, respectively.
- 
getTokenAt- Returns:
- the token at the given row and column.
 
- 
getNumRowspublic int getNumRows()- Returns:
- the number of rows, as set in the constructor.
 
- 
getNumColumnspublic int getNumColumns()- Returns:
- the number of rows, as set in the constructor.
 
- 
setColumnSpacingpublic void setColumnSpacing(int numSpaces) Sets the number of spaces between columns, to some number >= 0.
- 
setJustificationpublic void setJustification(int justification) Sets the justification, either LEFT_JUSTIFIED or RIGHT_JUSTIFIED.
- 
toString
- 
setDelimiter
 
-