Example usage for com.google.common.net InetAddresses isMaximum

List of usage examples for com.google.common.net InetAddresses isMaximum

Introduction

In this page you can find the example usage for com.google.common.net InetAddresses isMaximum.

Prototype

public static boolean isMaximum(InetAddress address) 

Source Link

Document

Returns true if the InetAddress is either 255.255.255.255 for IPv4 or ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff for IPv6.

Usage

From source file:google.registry.util.CidrAddressBlock.java

@Override
public Iterator<InetAddress> iterator() {
    return new AbstractSequentialIterator<InetAddress>(ip) {
        @Override//from   w  w  w.  ja v  a  2s.c  om
        protected InetAddress computeNext(InetAddress previous) {
            if (InetAddresses.isMaximum(previous)) {
                return null;
            }

            InetAddress next = InetAddresses.increment(previous);
            return (contains(next)) ? next : null;
        }
    };
}