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 Details

    • AbstractOffsetMap

      protected AbstractOffsetMap(K[] emptyKeys, Comparator<K> comparator, com.google.common.collect.ImmutableSet<K> routerIds)
  • Method Details

    • getKey

      public final K getKey(int offset)
    • offsetOf

      public final int offsetOf(K key)
    • isEmpty

      public final boolean isEmpty()
    • size

      public final int size()
    • with

      public final T with(K key)
    • without

      public final T without(K key)
    • 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()
    • instanceForKeys

      protected abstract T instanceForKeys(com.google.common.collect.ImmutableSet<K> newKeys)