public class MarkdownTable extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MarkdownTable.IndexSpanOffset |
| Modifier and Type | Field and Description |
|---|---|
static NumericSuffixPredicate |
ALL_SUFFIXES_NO_SORT |
static NumericSuffixPredicate |
ALL_SUFFIXES_SORT |
TableSection |
body |
TableSection |
caption |
static com.vladsch.flexmark.util.misc.CharPredicate |
COLON_TRIM_CHARS |
TableSection |
header |
static NumericSuffixPredicate |
NO_SUFFIXES |
TableFormatOptions |
options |
TableSection |
separator |
| Constructor and Description |
|---|
MarkdownTable(@NotNull CharSequence tableChars,
@Nullable com.vladsch.flexmark.util.data.DataHolder options) |
MarkdownTable(@NotNull CharSequence tableChars,
@Nullable TableFormatOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCell(@NotNull TableCell cell) |
boolean |
addTrackedOffset(int offset)
Deprecated.
Use
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset) |
boolean |
addTrackedOffset(int offset,
boolean afterSpace)
Deprecated.
Use
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset, afterSpace) |
boolean |
addTrackedOffset(int offset,
boolean afterSpace,
boolean afterDelete)
Deprecated.
Use
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset, afterSpace, afterDelete) |
boolean |
addTrackedOffset(int offset,
Character c,
boolean afterDelete)
Deprecated.
Use
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset, c, afterDelete) |
boolean |
addTrackedOffset(@NotNull TrackedOffset trackedOffset) |
static void |
appendFormattedCaption(com.vladsch.flexmark.util.sequence.LineAppendable out,
com.vladsch.flexmark.util.sequence.BasedSequence caption,
TableFormatOptions options) |
void |
appendTable(com.vladsch.flexmark.util.sequence.LineAppendable out) |
void |
deleteColumns(int column,
int count) |
void |
deleteRows(int rowIndex,
int count) |
void |
fillMissingColumns() |
void |
fillMissingColumns(Integer minColumn) |
void |
finalizeTable() |
void |
forAllBodyRows(int startIndex,
int count,
TableRowManipulator manipulator) |
void |
forAllBodyRows(int startIndex,
TableRowManipulator manipulator) |
void |
forAllBodyRows(TableRowManipulator manipulator) |
void |
forAllContentRows(int startIndex,
int count,
TableRowManipulator manipulator) |
void |
forAllContentRows(int startIndex,
TableRowManipulator manipulator) |
void |
forAllContentRows(TableRowManipulator manipulator) |
void |
forAllHeaderRows(int startIndex,
int count,
TableRowManipulator manipulator) |
void |
forAllHeaderRows(int startIndex,
TableRowManipulator manipulator) |
void |
forAllHeaderRows(TableRowManipulator manipulator) |
void |
forAllRows(int startIndex,
int count,
TableRowManipulator manipulator) |
void |
forAllRows(int startIndex,
TableRowManipulator manipulator) |
void |
forAllRows(TableRowManipulator manipulator) |
void |
forAllSectionRows(int startIndex,
int count,
TableRowManipulator manipulator) |
void |
forAllSectionRows(int startIndex,
TableRowManipulator manipulator) |
void |
forAllSectionRows(TableRowManipulator manipulator) |
static String |
formattedCaption(com.vladsch.flexmark.util.sequence.BasedSequence caption,
TableFormatOptions options) |
List<TableRow> |
getAllContentRows() |
int |
getAllContentRowsCount() |
List<TableRow> |
getAllRows() |
int |
getAllRowsCount() |
TableSection |
getAllRowsSection(int index) |
List<TableRow> |
getAllSectionRows() |
int |
getAllSectionsRowsCount() |
int |
getBodyRowCount() |
com.vladsch.flexmark.util.sequence.BasedSequence |
getCaption() |
TableCell |
getCaptionCell() |
int |
getCaptionRowCount() |
TableCellOffsetInfo |
getCellOffsetInfo(int offset) |
CharSequence |
getFormatTableIndentPrefix() |
boolean |
getHaveCaption() |
boolean |
getHeader() |
int |
getHeadingRowCount() |
int |
getMaxBodyColumns() |
int |
getMaxColumns() |
int |
getMaxColumnsWithoutColumns(boolean withSeparator,
int... skipColumns) |
int |
getMaxColumnsWithoutRows(boolean withSeparator,
int... skipRows) |
int |
getMaxHeadingColumns() |
int |
getMaxSeparatorColumns() |
int |
getMinColumns() |
int |
getMinColumnsWithoutColumns(boolean withSeparator,
int... skipColumns) |
int |
getMinColumnsWithoutRows(boolean withSeparator,
int... skipRows) |
int |
getSeparatorRowCount() |
CharSequence |
getTableChars() |
int |
getTableStartOffset() |
@Nullable TrackedOffset |
getTrackedOffset(int offset) |
int |
getTrackedOffsetIndex(int offset) |
@NotNull List<TrackedOffset> |
getTrackedOffsets() |
void |
insertColumns(int column,
int count) |
void |
insertRows(int rowIndex,
int count) |
boolean |
isAllRowsEmptyAt(int rowIndex)
Test a row for having all empty columns
|
boolean |
isAllRowsSeparator(int index) |
boolean |
isContentRowsEmptyAt(int rowIndex)
Test a row for having all empty columns
|
boolean |
isEmptyColumn(int column)
Test all rows for having given column empty.
|
boolean |
isSeparator() |
void |
moveColumn(int fromColumn,
int toColumn) |
void |
nextRow() |
void |
normalize() |
void |
setBody() |
void |
setCaption(CharSequence caption) |
void |
setCaptionCell(TableCell captionCell) |
void |
setCaptionWithMarkers(com.vladsch.flexmark.util.ast.Node tableCellNode,
CharSequence captionOpen,
CharSequence caption,
CharSequence captionClose) |
void |
setFormatTableIndentPrefix(CharSequence formatTableIndentPrefix) |
void |
setHeader() |
void |
setHeader(boolean header) |
void |
setSeparator() |
void |
setSeparator(boolean separator) |
MarkdownTable |
sorted(ColumnSort[] columnSorts,
int textCollectionFlags,
@Nullable NumericSuffixPredicate numericSuffixTester)
Sort table
|
String |
toString() |
MarkdownTable |
transposed(int columnHeaders)
Transpose table
|
public final TableSection header
public final TableSection separator
public final TableSection body
public final TableSection caption
public TableFormatOptions options
public static final com.vladsch.flexmark.util.misc.CharPredicate COLON_TRIM_CHARS
public static final NumericSuffixPredicate NO_SUFFIXES
public static final NumericSuffixPredicate ALL_SUFFIXES_SORT
public static final NumericSuffixPredicate ALL_SUFFIXES_NO_SORT
public MarkdownTable(@NotNull
@NotNull CharSequence tableChars,
@Nullable
@Nullable com.vladsch.flexmark.util.data.DataHolder options)
public MarkdownTable(@NotNull
@NotNull CharSequence tableChars,
@Nullable
@Nullable TableFormatOptions options)
public CharSequence getTableChars()
public TableCell getCaptionCell()
public CharSequence getFormatTableIndentPrefix()
public void setFormatTableIndentPrefix(CharSequence formatTableIndentPrefix)
public void setCaptionCell(TableCell captionCell)
public com.vladsch.flexmark.util.sequence.BasedSequence getCaption()
public void setCaption(CharSequence caption)
public void setCaptionWithMarkers(com.vladsch.flexmark.util.ast.Node tableCellNode,
CharSequence captionOpen,
CharSequence caption,
CharSequence captionClose)
public int getHeadingRowCount()
public int getSeparatorRowCount()
public int getBodyRowCount()
public int getCaptionRowCount()
public int getMaxHeadingColumns()
public int getMaxSeparatorColumns()
public int getMaxBodyColumns()
public boolean getHaveCaption()
public int getMinColumns()
public int getMaxColumns()
public int getMinColumnsWithoutColumns(boolean withSeparator,
int... skipColumns)
public int getMaxColumnsWithoutColumns(boolean withSeparator,
int... skipColumns)
public int getMinColumnsWithoutRows(boolean withSeparator,
int... skipRows)
public int getMaxColumnsWithoutRows(boolean withSeparator,
int... skipRows)
@NotNull public @NotNull List<TrackedOffset> getTrackedOffsets()
@Nullable public @Nullable TrackedOffset getTrackedOffset(int offset)
public int getTrackedOffsetIndex(int offset)
public int getTableStartOffset()
public TableCellOffsetInfo getCellOffsetInfo(int offset)
@Deprecated public boolean addTrackedOffset(int offset)
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset)@Deprecated public boolean addTrackedOffset(int offset, boolean afterSpace)
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset, afterSpace)@Deprecated public boolean addTrackedOffset(int offset, boolean afterSpace, boolean afterDelete)
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset, afterSpace, afterDelete)@Deprecated public boolean addTrackedOffset(int offset, Character c, boolean afterDelete)
addTrackedOffset(TrackedOffset)
To create: TrackedOffset.track(offset, c, afterDelete)public boolean addTrackedOffset(@NotNull
@NotNull TrackedOffset trackedOffset)
public boolean isAllRowsSeparator(int index)
public TableSection getAllRowsSection(int index)
public int getAllRowsCount()
public int getAllContentRowsCount()
public int getAllSectionsRowsCount()
public void forAllRows(TableRowManipulator manipulator)
public void forAllRows(int startIndex,
TableRowManipulator manipulator)
public void forAllRows(int startIndex,
int count,
TableRowManipulator manipulator)
public void forAllContentRows(TableRowManipulator manipulator)
public void forAllContentRows(int startIndex,
TableRowManipulator manipulator)
public void forAllContentRows(int startIndex,
int count,
TableRowManipulator manipulator)
public void forAllSectionRows(TableRowManipulator manipulator)
public void forAllSectionRows(int startIndex,
TableRowManipulator manipulator)
public void forAllSectionRows(int startIndex,
int count,
TableRowManipulator manipulator)
public void forAllHeaderRows(TableRowManipulator manipulator)
public void forAllHeaderRows(int startIndex,
TableRowManipulator manipulator)
public void forAllHeaderRows(int startIndex,
int count,
TableRowManipulator manipulator)
public void forAllBodyRows(TableRowManipulator manipulator)
public void forAllBodyRows(int startIndex,
TableRowManipulator manipulator)
public void forAllBodyRows(int startIndex,
int count,
TableRowManipulator manipulator)
public void deleteRows(int rowIndex,
int count)
public void insertRows(int rowIndex,
int count)
public void insertColumns(int column,
int count)
public void deleteColumns(int column,
int count)
public void moveColumn(int fromColumn,
int toColumn)
public boolean isEmptyColumn(int column)
column - index in allRows listpublic boolean isAllRowsEmptyAt(int rowIndex)
rowIndex - index in allRows listpublic boolean isContentRowsEmptyAt(int rowIndex)
rowIndex - index in allRows listpublic boolean getHeader()
public void setHeader(boolean header)
public boolean isSeparator()
public void setSeparator(boolean separator)
public void setHeader()
public void setSeparator()
public void setBody()
public void nextRow()
public void addCell(@NotNull
@NotNull TableCell cell)
cell - cell to addpublic void normalize()
public void finalizeTable()
public void fillMissingColumns()
public void fillMissingColumns(Integer minColumn)
public MarkdownTable transposed(int columnHeaders)
columnHeaders - number of first columns to use as header rows, 0..maxColumnspublic MarkdownTable sorted(ColumnSort[] columnSorts, int textCollectionFlags, @Nullable @Nullable NumericSuffixPredicate numericSuffixTester)
columnSorts - column sort informationtextCollectionFlags - collection flags to use for collecting cell textnumericSuffixTester - predicate to test non-numeric suffix of numeric column content, return true if suffix is acceptable, null will result in all suffixes being acceptedpublic void appendTable(com.vladsch.flexmark.util.sequence.LineAppendable out)
public static void appendFormattedCaption(com.vladsch.flexmark.util.sequence.LineAppendable out,
com.vladsch.flexmark.util.sequence.BasedSequence caption,
TableFormatOptions options)
public static String formattedCaption(com.vladsch.flexmark.util.sequence.BasedSequence caption, TableFormatOptions options)
Copyright © 2020. All rights reserved.