Class Document


  • public class Document
    extends java.lang.Object
    A document represents a list of elements and have a source.
    • Constructor Detail

      • Document

        public Document​(DocumentSource source,
                        ElementsFactory factory)
        Create a new document with the given source and element factory
        Parameters:
        source - the source
        factory - the element factory
    • Method Detail

      • getSource

        public DocumentSource getSource()
        Return the source of this document
        Returns:
        the source.
      • getElements

        public Document.Element[] getElements()
        Return the elements of this document
        Returns:
        the elements.
      • diff

        public DocumentDiff diff​(Document right)
        Create a diff between this document and the given one.
        Parameters:
        right - the other document to diff to.
        Returns:
        a diff.
      • reverseDiff

        public DocumentDiff reverseDiff​(Document left)
        Create a diff between the given document and this one.
        Parameters:
        left - the other document.
        Returns:
        a diff
      • diff3

        public DocumentDiff3 diff3​(Document left,
                                   Document right)
        Create a tree-way-diff using this document as base.
        Parameters:
        left - the left document
        right - the right document
        Returns:
        a diff3