Class ilib.NumPlan
Create a numbering plan information instance for a particular country's plan.
The options may contain any of the following properties:
- locale - locale for which the numbering plan is sought. This locale will be mapped to the actual numbering plan, which may be shared amongst a number of countries.
- onLoad - a callback function to call when the date format object is fully loaded. When the onLoad option is given, the DateFmt object will attempt to load any missing locale data using the ilib loader callback. When the constructor is done (even if the data is already preassembled), the onLoad function is called with the current instance as a parameter, so this callback can be used with preassembled or dynamic loading or a mix of the two.
- sync - tell whether to load any missing locale data synchronously or asynchronously. If this option is given as "false", then the "onLoad" callback must be given, as the instance returned from this constructor will not be usable for a while.
- loadParams - an object containing parameters to pass to the loader callback function when locale data is missing. The parameters are not interpretted or modified in any way. They are simply passed along. The object may contain any property/value pairs as long as the calling code is in agreement with the loader callback function as to what those parameters mean.
Defined in: ilib-dyn-full.js.
Constructor Attributes | Constructor Name and Description |
---|---|
ilib.NumPlan(options)
|
Method Attributes | Method Name and Description |
---|---|
Return a string containing all of the common format characters
used to format numbers.
|
|
[Need Comment]
Return a contextFree
|
|
Return true if this plan uses extended area codes.
|
|
getFieldLength(field)
Return the length of the field with the given name.
|
|
[Need Comment]
Return a findExtensions
|
|
Return the international direct dialing code of this plan.
|
|
getName()
Return the name of this plan.
|
|
Return the plan style for this plan.
|
|
[Need Comment]
Return a skipTrunk
|
|
Return the trunk code of the current plan as a string.
|
|
[Need Comment]
Return a skipTrunk
|
Class Detail
ilib.NumPlan(options)
- Parameters:
- {Object} options
- options governing the way this plan is loaded
Method Detail
{string}
getCommonFormatChars()
Return a string containing all of the common format characters
used to format numbers.
- Returns:
- {string} the common format characters fused in this locale
{boolean}
getContextFree()
[Need Comment]
Return a contextFree
- Returns:
- {boolean}
{boolean}
getExtendedAreaCode()
Return true if this plan uses extended area codes.
- Returns:
- {boolean} true if the plan uses extended area codes
{number}
getFieldLength(field)
Return the length of the field with the given name. If the length
is returned as 0, this means it is variable length.
- Parameters:
- {string} field
- name of the field for which the length is being sought
- Returns:
- {number} if positive, this gives the length of the given field. If zero, the field is variable length. If negative, the field is not known.
{boolean}
getFindExtensions()
[Need Comment]
Return a findExtensions
- Returns:
- {boolean}
{string}
getIDDCode()
Return the international direct dialing code of this plan.
- Returns:
- {string} the IDD code of this plan
{string}
getName()
Return the name of this plan. This may be different than the
name of the region because sometimes multiple countries share
the same plan.
- Returns:
- {string} the name of the plan
{string}
getPlanStyle()
Return the plan style for this plan. The plan style may be
one of:
- "open" - area codes may be left off if the caller is dialing to another number within the same area code
- "closed" - the area code must always be specified, even if calling another number within the same area code
- Returns:
- {string} the plan style, "open" or "closed"
{boolean}
getSkipTrunk()
[Need Comment]
Return a skipTrunk
- Returns:
- {boolean}
{string|undefined}
getTrunkCode()
Return the trunk code of the current plan as a string.
- Returns:
- {string|undefined} the trunk code of the plan or undefined if there is no trunk code in this plan
{boolean}
getTrunkRequired()
[Need Comment]
Return a skipTrunk
- Returns:
- {boolean}