Package com.imsl.test.example.math
Class PrintMatrixFormatEx2
java.lang.Object
com.imsl.math.PrintMatrixFormat
com.imsl.test.example.math.PrintMatrixFormatEx2
Prints a matrix in CSV format.
A matrix is printed in CSV (comma separated value) format. This is done by overriding theformat method of PrintMatrixFormat
to add commas after all but the last number in each row.-
Field Summary
Fields inherited from class com.imsl.math.PrintMatrixFormat
BEGIN_COLUMN_LABEL, BEGIN_COLUMN_LABELS, BEGIN_ENTRY, BEGIN_MATRIX, BEGIN_ROW, BEGIN_ROW_LABEL, COLUMN_LABEL, END_COLUMN_LABEL, END_COLUMN_LABELS, END_ENTRY, END_MATRIX, END_ROW, END_ROW_LABEL, ENTRY, numberFormat, ROW_LABEL -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.imsl.math.PrintMatrixFormat
getNumberFormat, setColumnLabels, setFirstColumnNumber, setFirstRowNumber, setNoColumnLabels, setNoRowLabels, setNumberFormat
-
Constructor Details
-
PrintMatrixFormatEx2
public PrintMatrixFormatEx2(int ncols)
-
-
Method Details
-
format
Description copied from class:PrintMatrixFormatReturns a formatted string. This method is used by the methodsprintandprintHTMLinPrintMatrix. This method can be overridden to gain finer control over printing.- Overrides:
formatin classPrintMatrixFormat- Parameters:
type- is the type of string requested.type return value BEGIN_MATRIX Tag for the beginning of the matrix. END_MATRIX Tag for the end of the matrix. BEGIN_COLUMN_LABELS Tag for the beginning of the column labels row. END_COLUMN_LABELS Tag for the end of the column labels row. BEGIN_COLUMN_LABEL Tag for the beginning of a column label. END_COLUMN_LABEL Tag for the end of a column label. COLUMN_LABEL The label of the specified column. BEGIN_ROW Tag for the beginning of a row. END_ROW Tag for the end of a row. BEGIN_ROW_LABEL Tag for the beginning of a row label. END_ROW_LABEL Tag for the end of a row label. ROW_LABEL The label of the specified row. ENTRY The row-col entry of the matrix entry- is the entry to be formatted. This is only used if type equals ENTRY. For other values of type, this can be set to null.row- is the (0-based) row number of the element to be formatted. This is -1 if there is no row number associated with this request.col- is the (0-based) column number of the element to be formatted. This is -1 if there is no column number associated with this request.pos- is a ParsePosition object used to indicate the alignment center of the return string. This is used only if type==ENTRY. If the entry is adoublethen the index is the position of the decimal point. If the entry is anintthen the index is the position of the end of the formatted integer.- Returns:
- is the
Stringto be put into the printed table. - See Also:
-
PrintMatrixFormat.BEGIN_MATRIXPrintMatrixFormat.END_MATRIXPrintMatrixFormat.BEGIN_COLUMN_LABELSPrintMatrixFormat.END_COLUMN_LABELSPrintMatrixFormat.BEGIN_COLUMN_LABELPrintMatrixFormat.END_COLUMN_LABELPrintMatrixFormat.COLUMN_LABELPrintMatrixFormat.BEGIN_ROWPrintMatrixFormat.END_ROWPrintMatrixFormat.BEGIN_ROW_LABELPrintMatrixFormat.END_ROW_LABELPrintMatrixFormat.ROW_LABELPrintMatrixFormat.ENTRY
-
main
-