package com.vladsch.flexmark.ext.tables;

import com.vladsch.flexmark.ast.CustomNode;
import com.vladsch.flexmark.util.sequence.BasedSequence;

/**
 * Table row of a {@link TableHead} or {@link TableBody} containing {@link TableCell TableCells}.
 */
public class TableRow extends CustomNode {
    /**
     * rowNumber within the table section: header, body, separator
     */
    private int rowNumber;

    @Override
    public void getAstExtra(StringBuilder out) {
        super.getAstExtra(out);
        if (rowNumber != 0) out.append(" rowNumber=").append(rowNumber);
    }

    @Override
    public BasedSequence[] getSegments() {
        return EMPTY_SEGMENTS;
    }

    public TableRow() {
    }

    public TableRow(BasedSequence chars) {
        super(chars);
    }

    public int getRowNumber() {
        return rowNumber;
    }

    public void setRowNumber(int rowNumber) {
        this.rowNumber = rowNumber;
    }
}
