test_class.declarator: logger = LoggerFactory.getLogger(E164CountryCodeUtilTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(E164CountryCodeUtilTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-locale/src/test/java/com/cloudhopper/commons/locale/E164CountryCodeUtilTest.java
test_class.identifier: E164CountryCodeUtilTest
test_case.body: @Test
      public void lookup() throws Exception {
          E164CountryCode result0 = E164CountryCodeUtil.lookup("1");
          Assert.assertEquals("US", result0.getIso());
          result0 = E164CountryCodeUtil.lookup("1313");
          Assert.assertEquals("US", result0.getIso());
          result0 = E164CountryCodeUtil.lookup("");
          Assert.assertEquals(null, result0);
          result0 = E164CountryCodeUtil.lookup("1416");
          Assert.assertEquals("CA", result0.getIso());
          result0 = E164CountryCodeUtil.lookup("18765551212");
          Assert.assertEquals("JM", result0.getIso());
          result0 = E164CountryCodeUtil.lookup("448765551212");
          Assert.assertEquals("GB", result0.getIso());
      }
test_case.class_method_signature: E164CountryCodeUtilTest.lookup()
test_case.full_signature: @Test public void lookup()
test_case.identifier: lookup
test_case.invocations: lookup assertEquals getIso lookup assertEquals getIso lookup assertEquals lookup assertEquals getIso lookup assertEquals getIso lookup assertEquals getIso
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void lookup()
focal_class.declarator: logger = LoggerFactory.getLogger(E164CountryCodeUtil.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(E164CountryCodeUtil.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: byPrefix
focal_class.modifier: private static
focal_class.original_string: private static HashMap<String,E164CountryCode> byPrefix;
focal_class.type: HashMap<String,E164CountryCode>
focal_class.var_name: byPrefix
focal_class.declarator: maxPrefixLength
focal_class.modifier: private static
focal_class.original_string: private static int maxPrefixLength;
focal_class.type: int
focal_class.var_name: maxPrefixLength
focal_class.file: ch-commons-locale/src/main/java/com/cloudhopper/commons/locale/E164CountryCodeUtil.java
focal_class.identifier: E164CountryCodeUtil
focal_class.class_method_signature: E164CountryCodeUtil.E164CountryCodeUtil()
focal_class.full_signature: private  E164CountryCodeUtil()
focal_class.identifier: E164CountryCodeUtil
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  E164CountryCodeUtil()
focal_class.class_method_signature: E164CountryCodeUtil.lookup(String address)
focal_class.full_signature: public static E164CountryCode lookup(String address)
focal_class.identifier: lookup
focal_class.modifiers: public static
focal_class.parameters: (String address)
focal_class.return: E164CountryCode
focal_class.signature: E164CountryCode lookup(String address)
focal_class.class_method_signature: E164CountryCodeUtil.parse(InputStream is)
focal_class.full_signature: public static HashMap<String,E164CountryCode> parse(InputStream is)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (InputStream is)
focal_class.return: HashMap<String,E164CountryCode>
focal_class.signature: HashMap<String,E164CountryCode> parse(InputStream is)
focal_method.body: public static E164CountryCode lookup(String address) {
          // analyze just the first few chars -- max of 4 or length of address
          int len = (address.length() > maxPrefixLength ? maxPrefixLength : address.length());
          // search backwards first, return the first result
          for (int i = len; i > 0; i--) {
              String prefix = address.substring(0, i);
              E164CountryCode entry = byPrefix.get(prefix);
              if (entry != null) {
                  return entry;
              }
          }
          // nothing found
          return null;
      }
focal_method.class_method_signature: E164CountryCodeUtil.lookup(String address)
focal_method.full_signature: public static E164CountryCode lookup(String address)
focal_method.identifier: lookup
focal_method.invocations: length length substring get
focal_method.modifiers: public static
focal_method.parameters: (String address)
focal_method.return: E164CountryCode
focal_method.signature: E164CountryCode lookup(String address)