Top Description Fields Constructors Methods
org.eclipse.jetty.util

public Class InetAddressSet

extends AbstractSet<String>
implements Set<String>, Predicate<InetAddress>
Class Inheritance
All Implemented Interfaces
java.util.function.Predicate, java.util.Set, java.util.Collection, java.lang.Iterable
Imports
java.net.InetAddress, java.util.AbstractSet, .HashMap, .Iterator, .Map, .Set, java.util.function.Predicate

A set of InetAddress patterns.

This is a Set of String patterns that are used to match a Predicate over InetAddress for containment semantics. The patterns that may be set are defined in InetAddressPattern.

This class is designed to work with IncludeExcludeSet

See Also
IncludeExcludeSet

Field Summary

Modifier and TypeField and Description
private Map<String, InetAddressPattern>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
add(String
element to be added to this set
pattern
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

public Iterator<String>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

public boolean
remove(Object
object to be removed from this set, if present
pattern
)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Set.remove, java.util.Collection.remove.

Removes the specified element from this set if it is present (optional operation).

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).

public boolean
test(InetAddress
the input argument
address
)

Implements java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Inherited from java.util.AbstractSet:
equalshashCoderemoveAll

Field Detail

_patternsback to summary
private Map<String, InetAddressPattern> _patterns

Constructor Detail

InetAddressSetback to summary
public InetAddressSet()

Method Detail

addback to summary
public boolean add(String pattern)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Doc from java.util.Set.add.

Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element e to this set if the set contains no element e2 such that Objects.equals(e, e2). If this set already contains the element, the call leaves the set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throw an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.

Parameters
pattern:String

element to be added to this set

Returns:boolean

true if this set did not already contain the specified element

Annotations
@Override
iteratorback to summary
public Iterator<String> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<String>

an iterator over the elements in this set

Annotations
@Override
removeback to summary
public boolean remove(Object pattern)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Set.remove, java.util.Collection.remove.

Doc from java.util.Set.remove.

Removes the specified element from this set if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this set contains such an element. Returns true if this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.)

Parameters
pattern:Object

object to be removed from this set, if present

Returns:boolean

true if this set contained the specified element

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override
testback to summary
public boolean test(InetAddress address)

Implements java.util.function.Predicate.test.

Doc from java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Parameters
address:InetAddress

the input argument

Returns:boolean

true if the input argument matches the predicate, otherwise false

Annotations
@Override