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.

  • 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()
      Returns true does not contain anything.
      Returns:
      true does not contain anything
    • rangeSize

      public final int rangeSize()
    • immutableCopy

      public abstract ImmutableUnsignedLongSet immutableCopy()
      Returns an immutable copy of this set.
      Returns:
      an immutable copy of this set
    • mutableCopy

      public final MutableUnsignedLongSet mutableCopy()
      Returns an mutable copy of this set.
      Returns:
      an mutable copy of this set
    • ranges

      public final NavigableSet<? extends UnsignedLongSet.Entry> ranges()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object