com.sun.multicast.allocation
Interface Address

All Known Implementing Classes:
IPv4Address

public interface Address

A network address.

Objects of this class and all values returned by their methods are immutable. That is, their values cannot change after they are constructed.


Method Summary
 int compareTo(java.lang.Object o)
          Compares this Address with another Object for order.
 AddressType getAddressType()
          Gets the AddressType of this Address.
 byte[] getBytes()
          Gets a byte array representing this Address.
 

Method Detail

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this Address with another Object for order. Returns a negative integer, zero, or a positive integer depending on whether this Address is less than, equal to, or greater than the other Object.

If this address is less than the other one, an integer less than zero is returned. If this address is greater than the other one, an integer greater than zero is returned. If the two addresses are equal, zero is returned. If the two addresses cannot be compared because they are of different AddressTypes, a ClassCastException is thrown.

This method imposes a total ordering on addresses of the same AddressType.

Parameters:
otherAddress - the Address to compare against
Returns:
an integer reflecting the outcome of the comparison
Throws:
java.lang.ClassCastException - if the Addresses are of different types

getBytes

public byte[] getBytes()
Gets a byte array representing this Address.
Returns:
a byte array representing this Address

getAddressType

public AddressType getAddressType()
Gets the AddressType of this Address.
Returns:
the AddressType of this Address


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.