summaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/internal/documents/Document.java
blob: 44d4db05d23610e5af55586c4799dd02c2fa9880 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.zwobble.mammoth.internal.documents;

import java.util.List;

public class Document implements DocumentElement, HasChildren {
    private final List<DocumentElement> children;
    private final Notes notes;
    private final List<Comment> comments;

    public Document(List<DocumentElement> children, Notes notes, List<Comment> comments) {
        this.children = children;
        this.notes = notes;
        this.comments = comments;
    }

    @Override
    public List<DocumentElement> getChildren() {
        return children;
    }

    @Override
    public DocumentElement replaceChildren(List<DocumentElement> newChildren) {
        return new Document(newChildren, this.notes, this.comments);
    }

    @Override
    public <T, U> T accept(DocumentElementVisitor<T, U> visitor, U context) {
        return visitor.visit(this, context);
    }

    public Notes getNotes() {
        return notes;
    }

    public List<Comment> getComments() {
        return comments;
    }
}