|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecthp.opencall.media.common.Address
hp.opencall.media.common.E164Address
Holds E164 addresses as an arbitrary number of digits optionally followed by :
- an arbitrary number of #, where # means one digit of any value.
- a *, as a wildcard for any number of digits.
Examples : 0476, 0476####, 0458*, ...
| Constructor Summary | |
E164Address(String aString,
int length)
Creates a E164Address from a String. |
|
| Method Summary | |
boolean |
equals(Object anAdd)
Indicates whether the two E164 addresses are equal. |
String |
getString()
Returns the address as a String. |
boolean |
greater(Address anAddr)
Indicates whether this address is greater than the passed address. |
boolean |
isInternalAddress()
FOR FUTURE USE. |
boolean |
overlap(Address anAddress)
Compares E164 addresses containing wildcards. |
String |
toString()
Returns the address as a String. |
| Methods inherited from class hp.opencall.media.common.Address |
hashCode |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public E164Address(String aString,
int length)
throws InvalidAddressFormat
aString - The E164 address string, e.g. 34###length - The string length.
For example: E164Address("34###",5)
| Method Detail |
public String getString()
public boolean equals(Object anAdd)
Equality is checked by the following simple rules:
0476 == 0476
0476# == 04769
0476* == 04762584488
0476* == 047645######
0476* == 047##
This method is reflexive and symmetric, but not transitive. If you want to use E164Address as keys in hashtables, you should use a subset of addresse for which the method is also transitive, typically addresses without * or #.
equals in class Addresspublic boolean greater(Address anAddr)
This method is transitive.
The convention is that a E164Address is greater than any other instance
of classes extending Address.
The following rules apply for the comparison :
1. An address with a * is greater than an address without *.
2. If the two addresses have a *, the greatest is the longest. If they
have the same length, the digits are compared.
3. For the other addresses, the length is compared first. The longest is
the greatest. If they have the same length, digits are compared until
a # is found.If they have the same digits up to the first #, the
greatest is the one with the largest number of #. Then if they have
the same number of # they are equal.
greater in class Addresspublic String toString()
This should be equivalent to getString().
toString in class Addresspublic boolean overlap(Address anAddress)
overlap in class Addresspublic boolean isInternalAddress()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||