java.lang.Object
net.i2p.router.transport.StrictCountries
Maintains list of countries with strict application restrictions. Maintain a list of countries that may have tight restrictions on applications like ours.
The country set is stored as a sorted array of case-normalized 2-letter integer keys so contains(String) performs no per-call String allocation (callers such as Router.isHidden check this on the hot path with GeoIP codes that are already lowercase).
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[]Sorted ascending for binary search; each key = ((c0 & 0xDF) << 8) | (c1 & 0xDF).Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUtility class, not intended for instantiation.Method Summary
All Methods
Field Details
_countries
private static final int[] _countriesSorted ascending for binary search; each key = ((c0 & 0xDF) << 8) | (c1 & 0xDF).
Constructor Details
StrictCountries
private StrictCountries()Utility class, not intended for instantiation.
Method Details
contains
Whether the country is in the restricted set.- Parameters:
country- two-letter code, case-independent; null or any other length is not restricted- Returns:
- true if the code is in the restricted set