Top Description Fields Constructors Methods
com.google.thirdparty.publicsuffix

pack-priv final Class TrieParser

extends Object
Class Inheritance
Annotations
@GwtCompatible
Static Imports
com.google.common.collect.Queues.newArrayDeque

Parser for a map of reversed domain names stored as a serialized radix tree.

Field Summary

Modifier and TypeField and Description
private static final Joiner

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static int

Returns:

The number of characters consumed from encoded.
doParseTrieToBuilder
(Deque<CharSequence>
The prefixes that precede the characters represented by this node. Each entry of the stack is in reverse order.
stack
,
CharSequence
The serialized trie.
encoded
,
int
An index in the encoded serialized trie to begin reading characters from.
start
,
ImmutableMap.Builder<String, PublicSuffixType>
A map builder to which all entries will be added.
builder
)

Parses a trie node and returns the number of characters consumed.

pack-priv static ImmutableMap<String, PublicSuffixType>
pack-priv static ImmutableMap<String, PublicSuffixType>
parseTrie(CharSequence... encodedChunks)

Parses a serialized trie representation of a map of reversed public suffixes into an immutable map of public suffixes.

private static CharSequence
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DIRECT_JOINERback to summary
private static final Joiner DIRECT_JOINER

Constructor Detail

TrieParserback to summary
pack-priv TrieParser()

Method Detail

doParseTrieToBuilderback to summary
private static int doParseTrieToBuilder(Deque<CharSequence> stack, CharSequence encoded, int start, ImmutableMap.Builder<String, PublicSuffixType> builder)

Parses a trie node and returns the number of characters consumed.

Parameters
stack:Deque<CharSequence>

The prefixes that precede the characters represented by this node. Each entry of the stack is in reverse order.

encoded:CharSequence

The serialized trie.

start:int

An index in the encoded serialized trie to begin reading characters from.

builder:ImmutableMap.Builder<String, PublicSuffixType>

A map builder to which all entries will be added.

Returns:int

The number of characters consumed from encoded.

parseFullStringback to summary
pack-priv static ImmutableMap<String, PublicSuffixType> parseFullString(String encoded)
Annotations
@VisibleForTesting
parseTrieback to summary
pack-priv static ImmutableMap<String, PublicSuffixType> parseTrie(CharSequence... encodedChunks)

Parses a serialized trie representation of a map of reversed public suffixes into an immutable map of public suffixes. The encoded trie string may be broken into multiple chunks to avoid the 64k limit on string literal size. In-memory strings can be much larger (2G).

reverseback to summary
private static CharSequence reverse(CharSequence s)