public interface Document
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
equals(@Nullable java.lang.Object object)
Determines if the given
object equals this document or not. |
int |
hashCode()
Calculate the hash code of this document.
|
@NotNull java.io.InputStream |
openInputStream()
Open a new input-stream that reads the content of this document.
|
default @NotNull java.io.InputStream |
openInputStream(@NotNull Reference reference)
Open a new input-stream that reads the content at the given
reference in
this document. |
@NotNull java.io.Reader |
openReader()
Open a new reader that reads the content of this document.
|
default @NotNull java.io.Reader |
openReader(@NotNull Reference reference)
Open a new reader that reads the content at the given
reference in this
document. |
@NotNull java.lang.CharSequence |
read()
Read the content of this document.
|
default @NotNull java.lang.CharSequence |
read(@NotNull Reference reference)
Read the content at the given
reference in this document. |
@NotNull java.lang.String |
toString()
Returns a string representation of this document.
|
@NotNull @Contract(pure=true) default @NotNull java.io.InputStream openInputStream(@NotNull @NotNull Reference reference) throws java.io.IOException
reference
in
this document.reference
- the range to be read.java.io.IOException
- if any I/O exception occurs.DocumentNotFoundException
- if this document is not available for reading.@NotNull @Contract(pure=true) default @NotNull java.io.Reader openReader(@NotNull @NotNull Reference reference) throws java.io.IOException
reference
in this
document.reference
- the range to be read.java.io.IOException
- if any I/O exception occurs. (optional)DocumentNotFoundException
- if this document is not available for reading.@NotNull @Contract(pure=true) default @NotNull java.lang.CharSequence read(@NotNull @NotNull Reference reference)
reference
in this document.reference
- the range to be read.java.io.IOError
- if any I/O exception occurs. (optional)DocumentNotFoundError
- if this document is not available for reading.@Contract(value="null->false", pure=true) boolean equals(@Nullable @Nullable java.lang.Object object)
object
equals this document or not. An object
equals a document when that object is pointing to the same source as this document.
(regardless of its content, assuming the user is honest and does not provide two
documents with same source but from different origins or have different content)
equals = object instanceof Document && this.toString().equals(object.toString())
equals
in class java.lang.Object
object
- the object to be matched.object
is a document and equals this document.@Contract(pure=true) int hashCode()
hashCode = <SourceUniqIdentifiers>
hashCode
in class java.lang.Object
@NotNull @Contract(pure=true) @NotNull java.lang.String toString()
toString = <SourceUniqName>
toString
in class java.lang.Object
@NotNull @Contract(pure=true) @NotNull java.io.InputStream openInputStream() throws java.io.IOException
java.io.IOException
- if any I/O exception occurs.DocumentNotFoundException
- if this document is not available for reading.@NotNull @Contract(pure=true) @NotNull java.io.Reader openReader() throws java.io.IOException
java.io.IOException
- if any I/O exception occurs. (optional)DocumentNotFoundException
- if this document is not available for reading.@NotNull @Contract(pure=true) @NotNull java.lang.CharSequence read()
java.io.IOError
- if any I/O exception occurs. (optional)DocumentNotFoundError
- if this document is not available for reading.