|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecthp.opencall.media.common.Address
Defines a generic way to name & manipulate:
1- Externally visible objects implemented by the system like
Managed Objects, etc..
2- External Addresses involved in the call control e.g., E.164, IP etc...
The advantage of using this class is the number of built-in hashing and comparaison functions that makes it easy to use these objects as indexes.
Provides a way to wildcard a part of an address, e.g. for IP 125.12.*.*.
Wildcarding is limited to preserve the ordering i.e., 124.12.*.2 is illegal.
Provides support to manipulate set of addresses.
Immutable Objects & serializables
WARNING: The E164Address class extends Address, but there is no point trying to pass a E164Address referenced as an Address as an argument to one of the methods defined here. It won't make sense as the E164Address class needed to be more complete and so broke the logic of the abstract class. This is not a problem for another class extending Address except for the greater method. In the class E164Address, this method has been overriden and says that a E164Address is greater than any type of address. So you should be aware of this, the proper way to do it would be to keep the beginning of the comparaison in the greater method here and to specialize it in the subclasses.
| Method Summary | |
boolean |
equals(Object anAddr)
Indicates whether the two addresses are equal. |
boolean |
greater(Address anAddress)
Indicates whether this address is strictly greater than the passed address. |
int |
hashCode()
|
boolean |
overlap(Address anAddress)
Compares addresses containing wildcards. |
String |
toString()
Returns the address as a printable string. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
public int hashCode()
public boolean equals(Object anAddr)
Can compare two (non wildcard) addresses or an address and a wildcard.
public boolean greater(Address anAddress)
Assumes that hashCode always returns different values for different Class objects.
public boolean overlap(Address anAddress)
public String toString()
Recommended to use for debugging purposes only since this is not optimized.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||