Class AbstractOffsetMap<K extends org.opendaylight.yangtools.concepts.Immutable & Comparable<K>,T extends AbstractOffsetMap<K,T>>
- java.lang.Object
-
- org.opendaylight.protocol.bgp.mode.impl.AbstractOffsetMap<K,T>
-
@Beta public abstract class AbstractOffsetMap<K extends org.opendaylight.yangtools.concepts.Immutable & Comparable<K>,T extends AbstractOffsetMap<K,T>> extends Object
A map maintaining a set of values in an external array corresponding to a set of keys. This class is expected to be used as a template, i.e. users subclass it to a concrete map and use exclusively that class to access the functionality.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOffsetMap(K[] emptyKeys, Comparator<K> comparator, com.google.common.collect.ImmutableSet<K> routerIds)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Comparator<K>
comparator()
protected abstract K[]
emptyKeys()
<C> C[]
expand(T oldOffsets, C[] oldArray, int offset)
K
getKey(int offset)
<C> C
getValue(C[] array, int offset)
protected abstract T
instanceForKeys(com.google.common.collect.ImmutableSet<K> newKeys)
boolean
isEmpty()
int
offsetOf(K key)
<C> C[]
removeValue(C[] oldArray, int offset, C[] emptyArray)
<C> void
setValue(C[] array, int offset, C value)
int
size()
T
with(K key)
T
without(K key)
-
-
-
Constructor Detail
-
AbstractOffsetMap
protected AbstractOffsetMap(K[] emptyKeys, Comparator<K> comparator, com.google.common.collect.ImmutableSet<K> routerIds)
-
-
Method Detail
-
getKey
public final K getKey(int offset)
-
offsetOf
public final int offsetOf(K key)
-
isEmpty
public final boolean isEmpty()
-
size
public final int size()
-
getValue
public final <C> C getValue(C[] array, int offset)
-
setValue
public final <C> void setValue(C[] array, int offset, C value)
-
expand
public final <C> C[] expand(T oldOffsets, C[] oldArray, int offset)
-
removeValue
public final <C> C[] removeValue(C[] oldArray, int offset, C[] emptyArray)
-
comparator
protected abstract Comparator<K> comparator()
-
emptyKeys
protected abstract K[] emptyKeys()
-
-