public abstract class AbstractFormatter extends PersistentObject
A column can be broader than specified by the parameter minColumnWidth (because a cell may not fit into that width) but a column is never smaller than minColumnWidth. Normally one does not need to specify minColumnWidth. Cells in a row are separated by a separator string, similar separators can be set for rows and slices. For more info, see the concrete subclasses.
Modifier and Type | Field and Description |
---|---|
static String |
CENTER
The alignment string aligning the cells of a column to its center.
|
static String |
DECIMAL
The alignment string aligning the cells of a column to the decimal point.
|
static String |
DEFAULT_COLUMN_SEPARATOR
The default string separating any two columns from another; currently
" ".
|
static int |
DEFAULT_MIN_COLUMN_WIDTH
The default minimum number of characters a column may have; currently
1.
|
static String |
DEFAULT_ROW_SEPARATOR
The default string separating any two rows from another; currently
"\n".
|
static String |
DEFAULT_SLICE_SEPARATOR
The default string separating any two slices from another; currently
"\n\n".
|
static String |
LEFT
The alignment string aligning the cells of a column to the left.
|
static String |
RIGHT
The alignment string aligning the cells of a column to the right.
|
Modifier and Type | Method and Description |
---|---|
void |
setAlignment(String alignment)
Sets the column alignment (left,center,right,decimal).
|
void |
setColumnSeparator(String columnSeparator)
Sets the string separating any two columns from another.
|
void |
setFormat(String format)
Sets the way a single cell value is to be formatted.
|
void |
setMinColumnWidth(int minColumnWidth)
Sets the minimum number of characters a column may have.
|
void |
setPrintShape(boolean printShape)
Specifies whether a string representation of a matrix is to be preceded
with a summary of its shape.
|
void |
setRowSeparator(String rowSeparator)
Sets the string separating any two rows from another.
|
void |
setSliceSeparator(String sliceSeparator)
Sets the string separating any two slices from another.
|
static String |
shape(AbstractMatrix1D matrix)
Returns a short string representation describing the shape of the matrix.
|
static String |
shape(AbstractMatrix2D matrix)
Returns a short string representation describing the shape of the matrix.
|
static String |
shape(AbstractMatrix3D matrix)
Returns a short string representation describing the shape of the matrix.
|
clone
public static final String LEFT
public static final String CENTER
public static final String RIGHT
public static final String DECIMAL
public static final int DEFAULT_MIN_COLUMN_WIDTH
public static final String DEFAULT_COLUMN_SEPARATOR
public static final String DEFAULT_ROW_SEPARATOR
public static final String DEFAULT_SLICE_SEPARATOR
public void setAlignment(String alignment)
alignment
- the new alignment to be used; must be one of
{LEFT,CENTER,RIGHT,DECIMAL}.public void setColumnSeparator(String columnSeparator)
columnSeparator
- the new columnSeparator to be used.public void setFormat(String format)
format
- the new format to be used.public void setMinColumnWidth(int minColumnWidth)
minColumnWidth
- the new minColumnWidth to be used.public void setPrintShape(boolean printShape)
printShape
- true shape summary is printed, otherwise not printed.public void setRowSeparator(String rowSeparator)
rowSeparator
- the new rowSeparator to be used.public void setSliceSeparator(String sliceSeparator)
sliceSeparator
- the new sliceSeparator to be used.public static String shape(AbstractMatrix1D matrix)
public static String shape(AbstractMatrix2D matrix)
public static String shape(AbstractMatrix3D matrix)
Jump to the Parallel Colt Homepage