com.google.common.base.Predicate<URIResponse>
, Parser<java.lang.Void>
, Filter<URIResponse>
, FlyweightPrototype<Filter<URIResponse>>
, java.util.function.Predicate<URIResponse>
public class BinaryParser extends java.lang.Object implements Parser<java.lang.Void>
Parser.LinkReceiver, Parser.TextProcessor<T>
FILTER_PACKAGE_NAME
NULL_LINK_RECEIVER
Constructor | Description |
---|---|
BinaryParser(com.google.common.hash.HashFunction hashFunction) |
Builds a parser for digesting a page.
|
BinaryParser(com.google.common.hash.HashFunction hashFunction,
boolean crossAuthorityDuplicates) |
|
BinaryParser(java.lang.String messageDigestAlgorithm) |
Builds a parser for digesting a page.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
apply(URIResponse response) |
|
java.lang.Object |
clone() |
|
BinaryParser |
copy() |
This method strengthens the return type of the method inherited from
Filter . |
static com.google.common.hash.HashFunction |
forName(java.lang.String messageDigest) |
Return the hash function corresponding to a given message-digest algorithm given by name.
|
java.lang.String |
guessedCharset() |
Returns a guessed charset for the document, or
null if the charset could not be
guessed. |
com.google.common.hash.Hasher |
init(java.net.URI url) |
|
byte[] |
parse(java.net.URI uri,
org.apache.http.HttpResponse httpResponse,
Parser.LinkReceiver linkReceiver) |
Parses a response.
|
java.lang.Void |
result() |
Returns the result of the processing.
|
public BinaryParser(com.google.common.hash.HashFunction hashFunction)
hashFunction
- the hash function used to digest, null
if no digesting will be performed.public BinaryParser(com.google.common.hash.HashFunction hashFunction, boolean crossAuthorityDuplicates)
public BinaryParser(java.lang.String messageDigestAlgorithm) throws java.security.NoSuchAlgorithmException
messageDigestAlgorithm
- the digesting algorithm (as a string).java.security.NoSuchAlgorithmException
public static final com.google.common.hash.HashFunction forName(java.lang.String messageDigest) throws java.security.NoSuchAlgorithmException
messageDigest
- a message-digest algorithm (e.g., MurmurHash3
or MD5
); null
if messageDigest
is the empty string.java.security.NoSuchAlgorithmException
public com.google.common.hash.Hasher init(java.net.URI url)
public byte[] parse(java.net.URI uri, org.apache.http.HttpResponse httpResponse, Parser.LinkReceiver linkReceiver) throws java.io.IOException
Parser
public boolean apply(URIResponse response)
apply
in interface com.google.common.base.Predicate<URIResponse>
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String guessedCharset()
Parser
null
if the charset could not be
guessed.guessedCharset
in interface Parser<java.lang.Void>
null
.public BinaryParser copy()
Parser
Filter
.copy
in interface FlyweightPrototype<Filter<URIResponse>>
copy
in interface Parser<java.lang.Void>