Package org.wildfly.common.net
Class CidrAddressTable<T>
- java.lang.Object
-
- org.wildfly.common.net.CidrAddressTable<T>
-
- All Implemented Interfaces:
java.lang.Iterable<CidrAddressTable.Mapping<T>>
public final class CidrAddressTable<T> extends java.lang.Object implements java.lang.Iterable<CidrAddressTable.Mapping<T>>
A table for mapping IP addresses to objects usingCidrAddressinstances for matching.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCidrAddressTable.Mapping<T>A single mapping in the table.
-
Constructor Summary
Constructors Constructor Description CidrAddressTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()CidrAddressTable<T>clone()Tget(java.net.InetAddress address)TgetOrDefault(java.net.InetAddress address, T defVal)booleanisEmpty()java.util.Iterator<CidrAddressTable.Mapping<T>>iterator()Tput(CidrAddress block, T value)TputIfAbsent(CidrAddress block, T value)TremoveExact(CidrAddress block)booleanremoveExact(CidrAddress block, T expect)TreplaceExact(CidrAddress block, T value)booleanreplaceExact(CidrAddress block, T expect, T update)intsize()java.util.Spliterator<CidrAddressTable.Mapping<T>>spliterator()java.lang.StringtoString()
-
-
-
Method Detail
-
get
public T get(java.net.InetAddress address)
-
put
public T put(CidrAddress block, T value)
-
putIfAbsent
public T putIfAbsent(CidrAddress block, T value)
-
replaceExact
public T replaceExact(CidrAddress block, T value)
-
replaceExact
public boolean replaceExact(CidrAddress block, T expect, T update)
-
removeExact
public T removeExact(CidrAddress block)
-
removeExact
public boolean removeExact(CidrAddress block, T expect)
-
clear
public void clear()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
clone
public CidrAddressTable<T> clone()
- Overrides:
clonein classjava.lang.Object
-
iterator
public java.util.Iterator<CidrAddressTable.Mapping<T>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<T>
-
spliterator
public java.util.Spliterator<CidrAddressTable.Mapping<T>> spliterator()
- Specified by:
spliteratorin interfacejava.lang.Iterable<T>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-