public class PseudoDocument extends java.lang.Object implements Document
Modifier and Type | Field and Description |
---|---|
protected @NotNull java.lang.CharSequence |
content
The content of this document.
|
protected @NotNull java.lang.String |
identifier
The identifier of this document.
|
Constructor and Description |
---|
PseudoDocument()
Construct a new pseudo document that has no content neither can be identified.
|
PseudoDocument(@NotNull java.lang.CharSequence content)
Construct a new pseudo document that have the given
content . |
PseudoDocument(@NotNull java.lang.String identifier,
@NotNull java.lang.CharSequence content)
Construct a new pseudo document that have the given
content and be
identified with the given identifier . |
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.
|
@NotNull java.io.Reader |
openReader()
Open a new reader that reads the content of this document.
|
@NotNull java.lang.CharSequence |
read()
Read the content of this document.
|
@NotNull java.lang.String |
toString()
Returns a string representation of this document.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
openInputStream, openReader, read
@NotNull protected final @NotNull java.lang.CharSequence content
@NotNull protected final @NotNull java.lang.String identifier
public PseudoDocument()
public PseudoDocument(@NotNull @NotNull java.lang.CharSequence content)
content
. The identifier
of the constructed document will be the string in hex of the identitiy hash code
of the given content.
content
- the content of the constructed pseudo content.java.lang.NullPointerException
- if the given content
is null.public PseudoDocument(@NotNull @NotNull java.lang.String identifier, @NotNull @NotNull java.lang.CharSequence content)
content
and be
identified with the given identifier
.
identifier
- the identity of the constructed document.content
- the content of the constructed pseudo content.java.lang.NullPointerException
- if the given identifier
or content
is
null.public boolean equals(@Nullable @Nullable java.lang.Object object)
Document
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())
public int hashCode()
Document
hashCode = <SourceUniqIdentifiers>
@NotNull public @NotNull java.io.InputStream openInputStream()
Document
openInputStream
in interface Document
@NotNull public @NotNull java.io.Reader openReader()
Document
openReader
in interface Document
@NotNull public @NotNull java.lang.CharSequence read()
Document
@NotNull public @NotNull java.lang.String toString()
Document
toString = <SourceUniqName>