Pidgin

Class LocationRange

Represents a portion of an input stream, defined by a start position and a length.

Inheritance
Implements
Inherited Members
Declaration
public record LocationRange : IShiftable<LocationRange>, IEquatable<LocationRange>

Constructors

LocationRange(LocationRange)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
protected LocationRange(LocationRange original)
Parameters
Type Name Description

LocationRange

original

LocationRange(long, long)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public LocationRange(long Start, long Length)
Parameters
Type Name Description

long

Start

The starting location of the range.

long

Length

The length of the range.

Properties

End

The location immediately after the end of the range.

Declaration
public long End { get; }
Property Value
Type Description

long

EqualityContract

Represents a portion of an input stream, defined by a start position and a length.

Declaration
protected virtual Type EqualityContract { get; }
Property Value
Type Description

Type

Length

The length of the range.

Declaration
public long Length { get; init; }
Property Value
Type Description

long

Start

The starting location of the range.

Declaration
public long Start { get; init; }
Property Value
Type Description

long

Methods

Deconstruct(out long, out long)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public void Deconstruct(out long Start, out long Length)
Parameters
Type Name Description

long

Start

long

Length

Equals(LocationRange?)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public virtual bool Equals(LocationRange? other)
Parameters
Type Name Description

LocationRange

other

Returns
Type Description

bool

Equals(object?)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description

object

obj

Returns
Type Description

bool

Overrides
object.Equals(object)

GetHashCode()

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public override int GetHashCode()
Returns
Type Description

int

Overrides
object.GetHashCode()

PrintMembers(StringBuilder)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
Type Name Description

StringBuilder

builder

Returns
Type Description

bool

ShiftBy(long)

Returns a copy of this result with all stored locations shifted by the specified amount.

Declaration
public LocationRange ShiftBy(long amount)
Parameters
Type Name Description

long

amount

The amount by which to shift locations.

Returns
Type Description

LocationRange

A new result with shifted locations.

Remarks

An implementation can simply return this if the object does not contain any source locations that would need shifting.

ToString()

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public override string ToString()
Returns
Type Description

string

Overrides
object.ToString()

Operators

operator ==(LocationRange?, LocationRange?)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public static bool operator ==(LocationRange? left, LocationRange? right)
Parameters
Type Name Description

LocationRange

left

LocationRange

right

Returns
Type Description

bool

operator !=(LocationRange?, LocationRange?)

Represents a portion of an input stream, defined by a start position and a length.

Declaration
public static bool operator !=(LocationRange? left, LocationRange? right)
Parameters
Type Name Description

LocationRange

left

LocationRange

right

Returns
Type Description

bool

Implements

IShiftable<T>
IEquatable<T>