Class TrieParser


  • @GwtCompatible
    final class TrieParser
    extends java.lang.Object
    Parser for a map of reversed domain names stored as a serialized radix tree.
    • Constructor Summary

      Constructors 
      Constructor Description
      TrieParser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static int doParseTrieToBuilder​(java.util.List<java.lang.CharSequence> stack, java.lang.CharSequence encoded, ImmutableMap.Builder<java.lang.String,​PublicSuffixType> builder)
      Parses a trie node and returns the number of characters consumed.
      (package private) static ImmutableMap<java.lang.String,​PublicSuffixType> parseTrie​(java.lang.CharSequence encoded)
      Parses a serialized trie representation of a map of reversed public suffixes into an immutable map of public suffixes.
      private static java.lang.CharSequence reverse​(java.lang.CharSequence s)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PREFIX_JOINER

        private static final Joiner PREFIX_JOINER
    • Constructor Detail

      • TrieParser

        TrieParser()
    • Method Detail

      • parseTrie

        static ImmutableMap<java.lang.String,​PublicSuffixType> parseTrie​(java.lang.CharSequence encoded)
        Parses a serialized trie representation of a map of reversed public suffixes into an immutable map of public suffixes.
      • doParseTrieToBuilder

        private static int doParseTrieToBuilder​(java.util.List<java.lang.CharSequence> stack,
                                                java.lang.CharSequence encoded,
                                                ImmutableMap.Builder<java.lang.String,​PublicSuffixType> builder)
        Parses a trie node and returns the number of characters consumed.
        Parameters:
        stack - The prefixes that preceed the characters represented by this node. Each entry of the stack is in reverse order.
        encoded - The serialized trie.
        builder - A map builder to which all entries will be added.
        Returns:
        The number of characters consumed from encoded.
      • reverse

        private static java.lang.CharSequence reverse​(java.lang.CharSequence s)