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 usingCidrAddress
instances for matching.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CidrAddressTable.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 void
clear()
CidrAddressTable<T>
clone()
T
get(java.net.InetAddress address)
T
getOrDefault(java.net.InetAddress address, T defVal)
boolean
isEmpty()
java.util.Iterator<CidrAddressTable.Mapping<T>>
iterator()
T
put(CidrAddress block, T value)
T
putIfAbsent(CidrAddress block, T value)
T
removeExact(CidrAddress block)
boolean
removeExact(CidrAddress block, T expect)
T
replaceExact(CidrAddress block, T value)
boolean
replaceExact(CidrAddress block, T expect, T update)
int
size()
java.util.Spliterator<CidrAddressTable.Mapping<T>>
spliterator()
java.lang.String
toString()
-
-
-
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:
clone
in classjava.lang.Object
-
iterator
public java.util.Iterator<CidrAddressTable.Mapping<T>> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T>
-
spliterator
public java.util.Spliterator<CidrAddressTable.Mapping<T>> spliterator()
- Specified by:
spliterator
in interfacejava.lang.Iterable<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-