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 interface
A single entry tracked in this set. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
contains
(long longBits) Check whether this set contains a value.final boolean
final int
hashCode()
abstract ImmutableUnsignedLongSet
Returns an immutable copy of this set.final boolean
isEmpty()
Returnstrue
does not contain anything.final MutableUnsignedLongSet
Returns an mutable copy of this set.final NavigableSet
<? extends UnsignedLongSet.Entry> ranges()
final int
final String
toString()
-
Method Details
-
contains
public final boolean contains(long longBits) Check whether this set contains a value.- Parameters:
longBits
- long value, interpreted as unsigned- Returns:
true
if this set contains the value
-
isEmpty
public final boolean isEmpty()Returnstrue
does not contain anything.- Returns:
true
does 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
-