public class NetMaskSet
extends java.lang.Object
| Constructor and Description |
|---|
NetMaskSet() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(NetMask netmask)
Adds a NetMask object to the set if the set does not contain it
|
boolean |
add(java.lang.String input)
Creates a NetMask object from the input string and adds it to the set.
|
java.util.List<java.lang.String> |
addAll(java.lang.String input)
|
void |
clear()
removes all entries from the set
|
boolean |
contains(java.net.InetAddress inetAddress)
Tests if the provided InetAddress matches any of the
NetMasks in the set. |
boolean |
contains(java.lang.String ipAddress)
Tests if the provided IP address matches any of the
NetMasks in the set. |
boolean |
isEmpty()
Tests if the set is empty.
|
java.lang.String |
toString()
Provides a string representation of this NetMaskSet.
|
public boolean contains(java.net.InetAddress inetAddress)
NetMasks in the set.inetAddress - An InetAddress to checktrue if the passed inetAddress is matched by any of the NetMasks in the setpublic boolean contains(java.lang.String ipAddress)
throws java.net.UnknownHostException
NetMasks in the set.ipAddress - an IP address to checktrue if the passed IP address is matched by any of the NetMasks in the setjava.net.UnknownHostException - if the passed input is not a valid IP addresspublic boolean add(NetMask netmask)
netmask - The NetMask to addpublic boolean add(java.lang.String input)
input - The string from which to construct the NetMaskjava.lang.IllegalArgumentException - if the input is not a valid CIDR format.public void clear()
public boolean isEmpty()
true if the set is empty, otherwise falsepublic java.util.List<java.lang.String> addAll(java.lang.String input)
NetMask list from a string input containing a comma-separated list of (hopefully valid)
NetMasks.input - The input stringpublic java.lang.String toString()
toString in class java.lang.ObjectNetMasks in this setCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.