/** * Returns {@code true} if the provided row key is among the row keys * provided when the table was constructed. */ @Override public boolean containsRow(@Nullable Object rowKey) { return rowKeyToIndex.containsKey(rowKey); }
/** * Does the domain name match one of the "wildcard" patterns (e.g. {@code "*.ar"})? */ private static boolean matchesWildcardPublicSuffix(String domain) { final String[] pieces = domain.split(DOT_REGEX, 2); return pieces.length == 2 && PublicSuffixPatterns.UNDER.containsKey(pieces[1]); }
@Override public boolean contains(@Nullable Object object) { return map.containsKey(object); }
/** * Returns {@code true} if the provided column key is among the column keys * provided when the table was constructed. */ @Override public boolean containsColumn(@Nullable Object columnKey) { return columnKeyToIndex.containsKey(columnKey); }
@Override public boolean containsKey(@Nullable Object key) { return keyIndex.containsKey(key); }
@Override public boolean containsKey(@Nullable Object key) { return map.containsKey(key); }
/** * Returns the index of the leftmost part of the public suffix, or -1 if not found. Note that the * value defined as the "public suffix" may not be a public suffix according to * {@link #isPublicSuffix()} if the domain ends with an excluded domain pattern such as * {@code "nhs.uk"}. */ private int findPublicSuffix() { final int partsSize = parts.size(); for (int i = 0; i < partsSize; i++) { String ancestorName = DOT_JOINER.join(parts.subList(i, partsSize)); if (PublicSuffixPatterns.EXACT.containsKey(ancestorName)) { return i; } // Excluded domains (e.g. !nhs.uk) use the next highest // domain as the effective public suffix (e.g. uk). if (PublicSuffixPatterns.EXCLUDED.containsKey(ancestorName)) { return i + 1; } if (matchesWildcardPublicSuffix(ancestorName)) { return i; } } return NO_PUBLIC_SUFFIX_FOUND; }