com.google.i18n.phonenumbers
Class ShortNumberUtil
java.lang.Object
com.google.i18n.phonenumbers.ShortNumberUtil
public class ShortNumberUtil
- extends Object
Method Summary |
boolean |
connectsToEmergencyNumber(String number,
String regionCode)
Returns true if the number might be used to connect to an emergency service in the given
region. |
boolean |
isEmergencyNumber(String number,
String regionCode)
Returns true if the number exactly matches an emergency service number in the given region. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShortNumberUtil
public ShortNumberUtil()
connectsToEmergencyNumber
public boolean connectsToEmergencyNumber(String number,
String regionCode)
- Returns true if the number might be used to connect to an emergency service in the given
region.
This method takes into account cases where the number might contain formatting, or might have
additional digits appended (when it is okay to do that in the region specified).
- Parameters:
number
- the phone number to testregionCode
- the region where the phone number is being dialed
- Returns:
- if the number might be used to connect to an emergency service in the given region.
isEmergencyNumber
public boolean isEmergencyNumber(String number,
String regionCode)
- Returns true if the number exactly matches an emergency service number in the given region.
This method takes into account cases where the number might contain formatting, but doesn't
allow additional digits to be appended.
- Parameters:
number
- the phone number to testregionCode
- the region where the phone number is being dialed
- Returns:
- if the number exactly matches an emergency services number in the given region.
Copyright © 2012 Google. All Rights Reserved.