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 protectedAbstractOffsetMap(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)KgetKey(int offset)<C> CgetValue(C[] array, int offset)protected abstract TinstanceForKeys(com.google.common.collect.ImmutableSet<K> newKeys)booleanisEmpty()intoffsetOf(K key)<C> C[]removeValue(C[] oldArray, int offset, C[] emptyArray)<C> voidsetValue(C[] array, int offset, C value)intsize()Twith(K key)Twithout(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()
-
-