class TableCell extends Node implements DelimitedNode {
    protected BasedSequence openingMarker = BasedSequence.NULL;
    protected BasedSequence text = BasedSequence.NULL;
    protected BasedSequence closingMarker = BasedSequence.NULL;

    private boolean header;
    private Alignment alignment;
    private int span = 1;

    public void trimWhiteSpace() {<FILL_FUNCTION_BODY>}

    public void mergeWhiteSpace() {
        boolean hadWhitespace = false;
        Node child = getFirstChild();

        while (child instanceof WhiteSpace) {
            Node next = child.getNext();
            Text text = new Text(child.getChars());
            child.insertBefore(text);
            child.unlink();
            child = next;
            hadWhitespace = true;
        }

        child = getLastChild();
        while (child instanceof WhiteSpace) {
            Node previous = child.getPrevious();
            Text text = new Text(child.getChars());
            child.insertBefore(text);
            child.unlink();
            child = previous;
            hadWhitespace = true;
        }

        if (hadWhitespace) {
            TextNodeConverter.mergeTextNodes(this);
        }
    }

    @Override
    public BasedSequence getOpeningMarker() {
        return openingMarker;
    }

    @Override
    public void setOpeningMarker(BasedSequence openingMarker) {
        this.openingMarker = openingMarker;
    }

    @Override
    public BasedSequence getText() {
        return text;
    }

    @Override
    public void setText(BasedSequence text) {
        this.text = text;
    }

    @Override
    public BasedSequence getClosingMarker() {
        return closingMarker;
    }

    @Override
    public void setClosingMarker(BasedSequence closingMarker) {
        this.closingMarker = closingMarker;
    }

    public int getSpan() {
        return span;
    }

    public void setSpan(int span) {
        this.span = span;
    }

    @NotNull
    @Override
    public BasedSequence[] getSegments() {
        return new BasedSequence[] { openingMarker, text, closingMarker };
    }

    @Override
    public void getAstExtra(@NotNull StringBuilder out) {
        if (alignment != null) out.append(" ").append(alignment);
        if (header) out.append(" header");
        if (span > 1) out.append(" span=" + span);
        delimitedSegmentSpanChars(out, openingMarker, text, closingMarker, "text");
    }

    public TableCell() {
    }

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

    /**
     * @return whether the cell is a header or not
     */
    public boolean isHeader() {
        return header;
    }

    public void setHeader(boolean header) {
        this.header = header;
    }

    /**
     * @return the cell alignment
     */
    public Alignment getAlignment() {
        return alignment;
    }

    public void setAlignment(Alignment alignment) {
        this.alignment = alignment;
    }

    /**
     * How the cell is aligned horizontally.
     */
    public enum Alignment {
        LEFT, CENTER, RIGHT;

        public CellAlignment cellAlignment() {
            switch (this) {
                case CENTER:
                    return CellAlignment.CENTER;
                case LEFT:
                    return CellAlignment.LEFT;
                case RIGHT:
                    return CellAlignment.RIGHT;
                default:
                    return CellAlignment.NONE;
            }
        }
    }
}

        Node firstChild = getFirstChild();
        Node child = firstChild;

        while (child instanceof WhiteSpace) {
            Node next = child.getNext();
            child.unlink();
            child = next;
        }

        child = getLastChild();
        while (child instanceof WhiteSpace) {
            Node next = child.getPrevious();
            child.unlink();
            child = next;
        }

        if (getFirstChild() == null && firstChild != null) {
            // we keep a single space from the child
            Node text = new Text(firstChild.getChars().subSequence(0, 1));
            appendChild(text);
        }
    
<methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,public void astString(@NotNull StringBuilder, boolean) ,public com.vladsch.flexmark.util.sequence.BasedSequence baseSubSequence(int, int) ,public com.vladsch.flexmark.util.sequence.BasedSequence baseSubSequence(int) ,public transient int countAncestorsOfType(@NotNull Class<?> []) ,public transient int countDirectAncestorsOfType(@Nullable Class<?>, @NotNull Class<?> []) ,public static void delimitedSegmentSpan(@NotNull StringBuilder, @NotNull BasedSequence, @NotNull BasedSequence, @NotNull BasedSequence, @NotNull String) ,public static void delimitedSegmentSpanChars(@NotNull StringBuilder, @NotNull BasedSequence, @NotNull BasedSequence, @NotNull BasedSequence, @NotNull String) ,public int endOfLine(int) ,public void extractChainTo(@NotNull Node) ,public void extractToFirstInChain(@NotNull Node) ,public transient @Nullable Node getAncestorOfType(@NotNull Class<?> []) ,public void getAstExtra(@NotNull StringBuilder) ,public com.vladsch.flexmark.util.sequence.BasedSequence getBaseSequence() ,public @NotNull Node getBlankLineSibling() ,public @NotNull BasedSequence getChars() ,public @NotNull BasedSequence getCharsFromSegments() ,public com.vladsch.flexmark.util.sequence.BasedSequence getChildChars() ,public @NotNull ReversiblePeekingIterator<Node> getChildIterator() ,public transient @Nullable Node getChildOfType(@NotNull Class<?> []) ,public @NotNull ReversiblePeekingIterable<Node> getChildren() ,public @NotNull ReversiblePeekingIterable<Node> getDescendants() ,public @NotNull Document getDocument() ,public com.vladsch.flexmark.util.sequence.BasedSequence getEmptyPrefix() ,public com.vladsch.flexmark.util.sequence.BasedSequence getEmptySuffix() ,public int getEndLineNumber() ,public int getEndOfLine() ,public int getEndOffset() ,public com.vladsch.flexmark.util.sequence.BasedSequence getExactChildChars() ,public @Nullable Node getFirstChild() ,public transient @Nullable Node getFirstChildAny(@NotNull Class<?> []) ,public transient @Nullable Node getFirstChildAnyNot(@NotNull Class<?> []) ,public @NotNull Node getFirstInChain() ,public @Nullable Node getGrandParent() ,public @Nullable Node getLastBlankLineChild() ,public @Nullable Node getLastChild() ,public transient @Nullable Node getLastChildAny(@NotNull Class<?> []) ,public transient @Nullable Node getLastChildAnyNot(@NotNull Class<?> []) ,public @NotNull Node getLastInChain() ,public static @NotNull BasedSequence getLeadSegment(@NotNull BasedSequence []) ,public Pair<java.lang.Integer,java.lang.Integer> getLineColumnAtEnd() ,public int getLineNumber() ,public @Nullable Node getNext() ,public transient @Nullable Node getNextAny(@NotNull Class<?> []) ,public transient @Nullable Node getNextAnyNot(@NotNull Class<?> []) ,public @NotNull String getNodeName() ,public static transient int getNodeOfTypeIndex(@NotNull Node, @NotNull Class<?> []) ,public transient int getNodeOfTypeIndex(@NotNull Class<?> []) ,public @Nullable Node getOldestAncestorOfTypeAfter(@NotNull Class<?>, @NotNull Class<?>) ,public @Nullable Node getParent() ,public @Nullable Node getPrevious() ,public transient @Nullable Node getPreviousAny(@NotNull Class<?> []) ,public transient @Nullable Node getPreviousAnyNot(@NotNull Class<?> []) ,public @NotNull ReversiblePeekingIterator<Node> getReversedChildIterator() ,public @NotNull ReversiblePeekingIterable<Node> getReversedChildren() ,public @NotNull ReversiblePeekingIterable<Node> getReversedDescendants() ,public abstract @NotNull BasedSequence [] getSegments() ,public @NotNull BasedSequence [] getSegmentsForChars() ,public com.vladsch.flexmark.util.sequence.Range getSourceRange() ,public int getStartLineNumber() ,public int getStartOfLine() ,public int getStartOffset() ,public int getTextLength() ,public static @NotNull BasedSequence getTrailSegment(com.vladsch.flexmark.util.sequence.BasedSequence[]) ,public boolean hasChildren() ,public boolean hasOrMoreChildren(int) ,public void insertAfter(@NotNull Node) ,public void insertBefore(com.vladsch.flexmark.util.ast.Node) ,public void insertChainAfter(@NotNull Node) ,public void insertChainBefore(@NotNull Node) ,public transient boolean isOrDescendantOfType(@NotNull Class<?> []) ,public Pair<java.lang.Integer,java.lang.Integer> lineColumnAtIndex(int) ,public Pair<java.lang.Integer,java.lang.Integer> lineColumnAtStart() ,public void moveTrailingBlankLines() ,public void prependChild(@NotNull Node) ,public void removeChildren() ,public static void segmentSpan(@NotNull StringBuilder, int, int, @Nullable String) ,public static void segmentSpan(@NotNull StringBuilder, @NotNull BasedSequence, @Nullable String) ,public static void segmentSpanChars(@NotNull StringBuilder, int, int, @Nullable String, @NotNull String) ,public static void segmentSpanChars(@NotNull StringBuilder, int, int, @Nullable String, @NotNull String, @NotNull String, @NotNull String) ,public static void segmentSpanChars(@NotNull StringBuilder, @NotNull BasedSequence, @NotNull String) ,public static void segmentSpanCharsToVisible(@NotNull StringBuilder, @NotNull BasedSequence, @NotNull String) ,public void setChars(@NotNull BasedSequence) ,public void setCharsFromContent() ,public void setCharsFromContentOnly() ,public void setCharsFromSegments() ,public static transient @NotNull BasedSequence spanningChars(com.vladsch.flexmark.util.sequence.BasedSequence[]) ,public int startOfLine(int) ,public void takeChildren(@NotNull Node) ,public @NotNull String toAstString(boolean) ,public static @NotNull String toSegmentSpan(@NotNull BasedSequence, @Nullable String) ,public java.lang.String toString() ,public void unlink() <variables>public static final AstNode<com.vladsch.flexmark.util.ast.Node> AST_ADAPTER,public static final com.vladsch.flexmark.util.sequence.BasedSequence[] EMPTY_SEGMENTS,public static final java.lang.String SPLICE,private @NotNull BasedSequence chars,@Nullable Node firstChild,private @Nullable Node lastChild,@Nullable Node next,private @Nullable Node parent,private @Nullable Node prev