Example usage for java.net Inet4Address isMulticastAddress

List of usage examples for java.net Inet4Address isMulticastAddress

Introduction

In this page you can find the example usage for java.net Inet4Address isMulticastAddress.

Prototype

public boolean isMulticastAddress() 

Source Link

Document

Utility routine to check if the InetAddress is an IP multicast address.

Usage

From source file:io.netlibs.bgp.protocol.attributes.NextHopPathAttribute.java

/**
 * set the next hop. If the next hop is semantically invalid, an exception is raised.
 * //w w w. jav  a 2 s.  com
 * @param nextHop
 *          the nextHop to set, MUST NOT be an IP multicast address
 * @throws IllegalArgumentException
 *           next hop address is a multicast address.
 */
public void setNextHop(Inet4Address nextHop) {
    if (nextHop.isMulticastAddress())
        throw new IllegalArgumentException();

    this.nextHop = new InetAddressNextHop<Inet4Address>(nextHop);
}