Package com.vladsch.flexmark.util.format
Class TableCellOffsetInfo
- java.lang.Object
-
- com.vladsch.flexmark.util.format.TableCellOffsetInfo
-
public class TableCellOffsetInfo extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description intcolumnprivate static java.util.HashMap<TableSectionType,java.lang.Integer>DEFAULT_STOP_POINTS_MAPjava.lang.IntegerinsideColumnjava.lang.IntegerinsideOffsetintoffsetintrowstatic intROW_ENDstatic intROW_STARTTableSectionsectionMarkdownTabletableTableCelltableCellTableRowtableRowstatic intTEXT_ENDstatic intTEXT_START
-
Constructor Summary
Constructors Constructor Description TableCellOffsetInfo(int offset, MarkdownTable table, TableSection section, TableRow tableRow, TableCell tableCell, int row, int column, java.lang.Integer insideColumn, java.lang.Integer insideOffset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDeleteColumn()booleancanDeleteRow()booleangetInsideColumn()TableCellgetPreviousCell()TableCellgetPreviousCell(int offset)TableCellgetPreviousCell(TableRow tableRow, int offset)private static intgetStopOffset(int offset, MarkdownTable table, java.util.Map<TableSectionType,java.lang.Integer> stopPointsMap, boolean nextOffset)Return the next/previous stop point of interestprivate static booleanhaveRowEnd(int flags)private static booleanhaveRowStart(int flags)private static booleanhaveStopPoint(int flags, int mask)private static booleanhaveTextEnd(int flags)private static booleanhaveTextStart(int flags)booleanisAfterCaption()booleanisAfterCells()booleanisBeforeCaption()booleanisBeforeCells()booleanisCaptionLine()booleanisFirstCell()booleanisInCellSpan()booleanisInsideCaption()booleanisInsideCell()booleanisLastCell()booleanisLastRow()booleanisSeparatorLine()TableCellOffsetInfonextCellOffset(java.lang.Integer insideOffset)Only available if tableRow/tableCell are set and not in first cell of first rowTableCellOffsetInfonextOffsetStop(java.util.Map<TableSectionType,java.lang.Integer> stopPointsMap)Available if somewhere in tableTableCellOffsetInfonextRowOffset(java.lang.Integer insideOffset)Only available if not at last rowTableCellOffsetInfopreviousCellOffset(java.lang.Integer insideOffset)Only available if inside are set and not in first cell of first rowTableCellOffsetInfopreviousOffsetStop(java.util.Map<TableSectionType,java.lang.Integer> stopPointsMap)Available if somewhere in tableTableCellOffsetInfopreviousRowOffset(java.lang.Integer insideOffset)Only available if not at row 0java.lang.StringtoString()
-
-
-
Field Detail
-
ROW_START
public static final int ROW_START
- See Also:
- Constant Field Values
-
TEXT_START
public static final int TEXT_START
- See Also:
- Constant Field Values
-
TEXT_END
public static final int TEXT_END
- See Also:
- Constant Field Values
-
ROW_END
public static final int ROW_END
- See Also:
- Constant Field Values
-
DEFAULT_STOP_POINTS_MAP
private static final java.util.HashMap<TableSectionType,java.lang.Integer> DEFAULT_STOP_POINTS_MAP
-
table
public final MarkdownTable table
-
offset
public final int offset
-
section
public final TableSection section
-
tableRow
public final TableRow tableRow
-
tableCell
public final TableCell tableCell
-
row
public final int row
-
column
public final int column
-
insideColumn
public final java.lang.Integer insideColumn
-
insideOffset
public final java.lang.Integer insideOffset
-
-
Constructor Detail
-
TableCellOffsetInfo
public TableCellOffsetInfo(int offset, MarkdownTable table, TableSection section, TableRow tableRow, TableCell tableCell, int row, int column, java.lang.Integer insideColumn, java.lang.Integer insideOffset)
-
-
Method Detail
-
isCaptionLine
public boolean isCaptionLine()
-
isSeparatorLine
public boolean isSeparatorLine()
-
isInsideCaption
public boolean isInsideCaption()
-
isAfterCaption
public boolean isAfterCaption()
-
isBeforeCaption
public boolean isBeforeCaption()
-
isInsideCell
public boolean isInsideCell()
-
getInsideColumn
public boolean getInsideColumn()
-
isBeforeCells
public boolean isBeforeCells()
-
getPreviousCell
public TableCell getPreviousCell()
-
getPreviousCell
public TableCell getPreviousCell(int offset)
-
isInCellSpan
public boolean isInCellSpan()
-
isAfterCells
public boolean isAfterCells()
-
canDeleteColumn
public boolean canDeleteColumn()
-
canDeleteRow
public boolean canDeleteRow()
-
isFirstCell
public boolean isFirstCell()
-
isLastCell
public boolean isLastCell()
-
isLastRow
public boolean isLastRow()
-
previousCellOffset
public TableCellOffsetInfo previousCellOffset(java.lang.Integer insideOffset)
Only available if inside are set and not in first cell of first rowCAUTION: NOT TESTED
- Parameters:
insideOffset- offset inside the cell, null if same as the current cell inside offset- Returns:
- offset in previous cell or null
-
nextCellOffset
public TableCellOffsetInfo nextCellOffset(java.lang.Integer insideOffset)
Only available if tableRow/tableCell are set and not in first cell of first rowCAUTION: NOT TESTED
- Parameters:
insideOffset- offset inside the cell, null if same as th- Returns:
- offset in previous cell or null
-
previousRowOffset
public TableCellOffsetInfo previousRowOffset(java.lang.Integer insideOffset)
Only available if not at row 0CAUTION: NOT TESTED
- Parameters:
insideOffset- offset inside the cell, null if same as th- Returns:
- offset in previous cell or null
-
nextRowOffset
public TableCellOffsetInfo nextRowOffset(java.lang.Integer insideOffset)
Only available if not at last rowCAUTION: NOT TESTED
- Parameters:
insideOffset- offset inside the cell, null if same as th- Returns:
- offset in previous cell or null
-
nextOffsetStop
public TableCellOffsetInfo nextOffsetStop(java.util.Map<TableSectionType,java.lang.Integer> stopPointsMap)
Available if somewhere in table- Parameters:
stopPointsMap- stop points of interest map by section or null- Returns:
- next stop point offset or offset after end of table
-
previousOffsetStop
public TableCellOffsetInfo previousOffsetStop(java.util.Map<TableSectionType,java.lang.Integer> stopPointsMap)
Available if somewhere in table- Parameters:
stopPointsMap- stop points of interest map by section or null for default- Returns:
- previous stop point offset or start of table offset
-
haveStopPoint
private static boolean haveStopPoint(int flags, int mask)
-
haveRowStart
private static boolean haveRowStart(int flags)
-
haveRowEnd
private static boolean haveRowEnd(int flags)
-
haveTextStart
private static boolean haveTextStart(int flags)
-
haveTextEnd
private static boolean haveTextEnd(int flags)
-
getStopOffset
private static int getStopOffset(int offset, MarkdownTable table, java.util.Map<TableSectionType,java.lang.Integer> stopPointsMap, boolean nextOffset)Return the next/previous stop point of interestNOTE: not terribly efficient because it goes through all cells of all rows. Only intended for UI use where this is not an issue since it is done per user key
- Parameters:
offset- current offsettable- for tablestopPointsMap- map of stop points by section or null for defaultnextOffset- true if next offset stop point, false for previous stop point of interest- Returns:
- stop point found or -1 if not found
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-