Package generic

Interface ULongSpan

All Superinterfaces:
Comparable<ULongSpan>, Span<Long,ULongSpan>
All Known Implementing Classes:
ULongSpan.Empty, ULongSpan.Impl

public interface ULongSpan extends Span<Long,ULongSpan>
A span of unsigned longs

While the type of endpoint is Long, the domain imposes unsigned behavior. To ensure consistent behavior in client code, comparisons and manipulations should be performed via DOMAIN, where applicable.

  • Field Details

  • Method Details

    • span

      static ULongSpan span(long min, long max)
      Create a closed interval of unsigned longs
      Parameters:
      min - the lower bound
      max - the upper bound
      Returns:
      the span
      Throws:
      IllegalArgumentException - if max < min
    • extent

      static ULongSpan extent(long min, long length)
      Create a closed interval of unsigned longs having a given length
      Parameters:
      min - the lower bound
      length - the length
      Returns:
      the span
      Throws:
      IllegalArgumentException - if the upper endpoint would exceed ULongSpan.Domain.max()
    • extent

      static ULongSpan extent(long min, int length)
      Create a closed interval of unsigned longs having the given (unsigned) length

      This operates the same as extent(long, int), but ensures the given length is treated as an unsigned integer.

      Parameters:
      min -
      length -
      Returns:
      the span
      Throws:
      IllegalArgumentException - if the upper endpoint would exceed ULongSpan.Domain.max()
    • length

      default long length()
      Get the length of the span
      Returns:
      the length