This class stores data belonging to decimal number ranges.
This class stores data belonging to decimal number ranges. This can be used
inside dial plans. Ranges with more than 2 permutations are compressed
automatically. When querying this the value of the longest matching path
will be returned. So if there are the ranges 1 and 11-13 when querying with
12, the later's value will be returned. This is as it holds the longer
prefix (2 digits instead of 1).
Example usage:
val lpm = new LongestPrefixMatch[String].
addValueForRange("123", "456", "V1").
addValueForRange("12345", "12349", "V2")
lpm.getValueFromPrefix("1234") // will return Some("V1")
lpm.getValueFromPrefix("12347") // will return Some("V2")
This class stores data belonging to decimal number ranges. This can be used inside dial plans. Ranges with more than 2 permutations are compressed automatically. When querying this the value of the longest matching path will be returned. So if there are the ranges 1 and 11-13 when querying with 12, the later's value will be returned. This is as it holds the longer prefix (2 digits instead of 1).
Example usage: