edu.byu.deg.framework.document
Class DOMDocument

java.lang.Object
  extended byedu.byu.deg.framework.document.DOMDocument
All Implemented Interfaces:
Document, TextDocument

public class DOMDocument
extends Object
implements TextDocument


Field Summary
(package private) static org.w3c.tidy.Tidy tidy
           
 
Constructor Summary
DOMDocument(Node node, Document parent)
           
DOMDocument(String filename)
          Creates a new instance of DOMDocument
DOMDocument(URI u)
           
 
Method Summary
 void addSubDocument(Node node)
           
 void addSubDocuments(ArrayList l)
           
 double getConfidence()
           
 InputStream getContentStream()
          Returns the contents of the document as a stream in order to avoid size issues.
 String getContentString()
          Returns the contents of the Document as a String.
 edu.byu.deg.ontos.DOMString getDOMString()
           
 Document getParentDocument()
           
 Node getRoot()
           
 DOMDocument getSubDocument(int index)
           
 int getSubDocumentCount()
           
 Iterator getSubDocuments()
          Returns an Iterator of Documents that are aggregated by this Document.
 URI getURI()
          Returns an identifier for the document; may be relative (particularly if this is a subdocument of another document) or absolute.
 void setConfidence(double conf)
           
 void setSubDocument(int i, Node node)
           
 void setURI(String s)
           
 void setURI(URI u)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tidy

static org.w3c.tidy.Tidy tidy
Constructor Detail

DOMDocument

public DOMDocument(String filename)
Creates a new instance of DOMDocument


DOMDocument

public DOMDocument(URI u)

DOMDocument

public DOMDocument(Node node,
                   Document parent)
Method Detail

getRoot

public Node getRoot()

getDOMString

public edu.byu.deg.ontos.DOMString getDOMString()

getSubDocuments

public Iterator getSubDocuments()
Description copied from interface: Document
Returns an Iterator of Documents that are aggregated by this Document.

Specified by:
getSubDocuments in interface Document
Returns:
The sub-documents belonging to this document, accessed via the returned Iterator. Implementing classes will determine whether the iterator accesses the sub-documents in depth-first order, breadth-first order, or some other sequence.

getSubDocument

public DOMDocument getSubDocument(int index)

addSubDocuments

public void addSubDocuments(ArrayList l)

addSubDocument

public void addSubDocument(Node node)

setSubDocument

public void setSubDocument(int i,
                           Node node)

getURI

public URI getURI()
Description copied from interface: Document
Returns an identifier for the document; may be relative (particularly if this is a subdocument of another document) or absolute.

Specified by:
getURI in interface Document
Returns:
The URI of this document.

setURI

public void setURI(URI u)

setURI

public void setURI(String s)

getParentDocument

public Document getParentDocument()

getSubDocumentCount

public int getSubDocumentCount()

toString

public String toString()

getContentStream

public InputStream getContentStream()
                             throws IOException
Description copied from interface: Document
Returns the contents of the document as a stream in order to avoid size issues.

Specified by:
getContentStream in interface Document
Returns:
The stream that yields the contents of the document.
Throws:
IOException - Thrown if there is any problem with creating the stream.

getContentString

public String getContentString()
                        throws IOException
Description copied from interface: TextDocument
Returns the contents of the Document as a String.

Specified by:
getContentString in interface TextDocument
Returns:
The textual contents of the Document.
Throws:
IOException

setConfidence

public void setConfidence(double conf)

getConfidence

public double getConfidence()