SpanOrVoid

sealed trait SpanOrVoid extends HasStartOrVoid with HasStopOrVoid
trait SpanLike
trait Writable
class Object
trait Matchable
class Any
object Void
trait Span

Value members

Abstract methods

def length: Long

The span's length. For a void span, this is zero, otherwise it is stop - start.

The span's length. For a void span, this is zero, otherwise it is stop - start.

def nonEmptyOption: Option[Span]
def shift(delta: Long): SpanOrVoid
def subtract(that: Open): SpanOrVoid
def subtract(that: SpanLike): IndexedSeq[SpanOrVoid]

Inherited methods

def clip(pos: Long): Long

Clips a position to this span's boundary. Note that the span's stop position is included. Thus the result is greater than or equal the start, and less than or equal (!) the stop.

Clips a position to this span's boundary. Note that the span's stop position is included. Thus the result is greater than or equal the start, and less than or equal (!) the stop.

For the special cases of Span.All and Span.Void, this method returns the argument unchanged.

Value Params
pos

the point to clip

Returns

the clipped point

Inherited from
SpanLike
def compareStart(pos: Long): Int

Compares the span's start to a given position

Compares the span's start to a given position

Returns

-1, if the span start lies before the query position, 1, if it lies after that position, or 0, if both are the same

Inherited from
SpanLike
def compareStop(pos: Long): Int

Compares the span's stop to a given position

Compares the span's stop to a given position

Returns

-1, if the span stop lies before the query position, 1, if it lies after that position, or 0, if both are the same

Inherited from
SpanLike
def contains(that: SpanLike): Boolean

Checks if another span lies within the span. The result is false if either of the two spans is void.

Checks if another span lies within the span. The result is false if either of the two spans is void.

Value Params
that

second span

Returns

true, if that.start >= this.start && that.stop <= this.stop

Inherited from
SpanLike
def contains(pos: Long): Boolean

Checks if a position lies within the span. Note that this returns false if this.stop == pos.

Checks if a position lies within the span. Note that this returns false if this.stop == pos.

Returns

true, if start <= pos < stop

Inherited from
SpanLike
def isEmpty: Boolean

Checks if the span is empty. A span is empty if it is a Span with start == stop or if it is void.

Checks if the span is empty. A span is empty if it is a Span with start == stop or if it is void.

Returns

true, if start == stop

Inherited from
SpanLike
def nonEmpty: Boolean

Checks if the span is non empty. This is exactly the opposite value of isEmpty.

Checks if the span is non empty. This is exactly the opposite value of isEmpty.

Inherited from
SpanLike
def overlaps(that: SpanLike): Boolean

Checks if a two spans overlap each other. Two spans overlap if the overlapping area is greater than or equal to 1. This implies that if either span is empty, the result will be false.

Checks if a two spans overlap each other. Two spans overlap if the overlapping area is greater than or equal to 1. This implies that if either span is empty, the result will be false.

This method is commutative (a overlaps b == b overlaps a).

Value Params
that

second span

Returns

true, if the spans overlap each other

Inherited from
SpanLike
def startOption: Option[Long]
Inherited from
SpanLike
def startOrElse(default: => Long): Long
Inherited from
SpanLike
def stopOption: Option[Long]
Inherited from
SpanLike
def stopOrElse(default: => Long): Long
Inherited from
SpanLike
def touches(that: SpanLike): Boolean

Checks if a two spans overlap or touch each other. Two spans touch each other if they either overlap or they share a common point with each other (this span's start or stop is that span's start or stop).

Checks if a two spans overlap or touch each other. Two spans touch each other if they either overlap or they share a common point with each other (this span's start or stop is that span's start or stop).

This method is commutative (a touches b == b touches a).

Value Params
that

second span

Returns

true, if the spans touch each other

Inherited from
SpanLike
def union(that: SpanLike): SpanLike

Constructs a single span which contains both this and that span. If the two spans are disjoint, the result will be a span with start = min(this.start, that.start) and stop = max(this.stop, that.stop). If either span is void, the other span is returned. If either span is Span.All, Span.All will be returned.

Constructs a single span which contains both this and that span. If the two spans are disjoint, the result will be a span with start = min(this.start, that.start) and stop = max(this.stop, that.stop). If either span is void, the other span is returned. If either span is Span.All, Span.All will be returned.

This method is commutative (a union b == b union a).

Value Params
that

the span to form the union with

Returns

the encompassing span

Inherited from
SpanLike
def write(out: DataOutput): Unit
Inherited from
Writable