https://github.com/vsirotin/matrixformatter
Simple Java 8 solution for formatting representation of matrix diverse types (Double, Integer, String etc.). This is the only class without using other libraries.
https://github.com/vsirotin/matrixformatter
Last synced: over 1 year ago
JSON representation
Simple Java 8 solution for formatting representation of matrix diverse types (Double, Integer, String etc.). This is the only class without using other libraries.
- Host: GitHub
- URL: https://github.com/vsirotin/matrixformatter
- Owner: vsirotin
- License: mit
- Created: 2017-01-29T20:32:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-27T09:21:13.000Z (about 2 years ago)
- Last Synced: 2025-01-29T06:41:23.018Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Simple Java 8 solution for formatting representation of matrix diverse types (Double, Integer, String etc.).
##This is the only class without using other libraries.
The matrix can be set e.g.as:
```
Integer[][] myMatrix = new Integer[][]{
new Integer[] {1, 2, 123456, 123},
new Integer[] {12, 1234, 12, 1},
new Integer[] {1, 123, 123456789, 12}
```
The result of formatting can be simple as:
```
[1, 2, 123456, 123]
[12, 1234, 12, 1 ]
[1, 123, 123456789, 12 ]
```
or with headers, footers and cell align.
The call of formatter with setting of formatting options can be made as:
```
String result = new MatrixFormatter<>(doubleMatrix).setHeader(_header2).setHeaderSeparator('-').setFooterSeparator('=').setSolumnSeparator("|").setAllignCell(AllignCell.CENTER).toString();
```
Please see JUnit test for details.