com.github.mkroli

lpm

package lpm

Visibility
  1. Public
  2. All

Type Members

  1. class LongestPrefixMatch[T] extends LongestPrefixMatchSugar[T]

    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")
  2. class LongestPrefixMatchJ[T >: AnyRef] extends AnyRef

    This is a wrapper around com.github.mkroli.lpm.LongestPrefixMatch for easier use with the Java language.

  3. trait LongestPrefixMatchSugar[T] extends AnyRef

Ungrouped