Class UnsignedLongSet
java.lang.Object
org.opendaylight.controller.cluster.raft.spi.UnsignedLongSet
- Direct Known Subclasses:
ImmutableUnsignedLongSet,MutableUnsignedLongSet
@NonNullByDefault
public abstract sealed class UnsignedLongSet
extends Object
permits ImmutableUnsignedLongSet, MutableUnsignedLongSet
A class holding an equivalent of
Set<UnsignedLong>. It is geared towards efficiently tracking ranges of
objects, similar to what a RangeSet<UnsignedLong> would do.
Unlike a RangeSet, though, this class takes advantage of knowing that an unsigned long is a discrete unit
and can be stored in a simple long.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA single entry tracked in this set. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancontains(long longBits) Check whether this set contains a value.final booleanfinal inthashCode()abstract ImmutableUnsignedLongSetReturns an immutable copy of this set.final booleanisEmpty()Returnstruedoes not contain anything.final MutableUnsignedLongSetReturns an mutable copy of this set.final NavigableSet<? extends UnsignedLongSet.Entry> ranges()final intfinal StringtoString()
-
Method Details
-
contains
public final boolean contains(long longBits) Check whether this set contains a value.- Parameters:
longBits- long value, interpreted as unsigned- Returns:
trueif this set contains the value
-
isEmpty
public final boolean isEmpty()Returnstruedoes not contain anything.- Returns:
truedoes not contain anything
-
rangeSize
public final int rangeSize() -
immutableCopy
Returns an immutable copy of this set.- Returns:
- an immutable copy of this set
-
mutableCopy
Returns an mutable copy of this set.- Returns:
- an mutable copy of this set
-
ranges
-
hashCode
public final int hashCode() -
equals
-
toString
-