Document.java 1.2 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.day.util.diff;

import com.day.util.diff.DocumentDiff;
import com.day.util.diff.DocumentDiff3;
import com.day.util.diff.DocumentSource;
import com.day.util.diff.ElementsFactory;

public class Document {
    static final String CVS_ID = "$URL$ $Rev$ $Date$";
    private final DocumentSource source;
    private final Element[] elements;

    public Document(DocumentSource source, ElementsFactory factory) {
        this.source = source;
        this.elements = factory.getElements();
    }

    public DocumentSource getSource() {
        return this.source;
    }

    public Element[] getElements() {
        return this.elements;
    }

    public DocumentDiff diff(Document right) {
        return new DocumentDiff(this, right);
    }

    public DocumentDiff reverseDiff(Document left) {
        return new DocumentDiff(left, this);
    }

    public DocumentDiff3 diff3(Document left, Document right) {
        return new DocumentDiff3(this, left, right);
    }

    public static interface AnnotatedElement
    extends Element {
        public DocumentSource getDocumentSource();
    }

    public static interface Element {
        public String getString();
    }

}