Class LocationRange
Represents a portion of an input stream, defined by a start position and a length.
Inheritance
- object
- LocationRange
Implements
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
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 |
---|---|---|
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 |
---|---|---|
Start |
The starting location of the range. |
|
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 |
---|---|
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 |
---|---|
Length
The length of the range.
Declaration
public long Length { get; init; }
Property Value
Type | Description |
---|---|
Start
The starting location of the range.
Declaration
public long Start { get; init; }
Property Value
Type | Description |
---|---|
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 |
---|---|---|
Start |
||
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 |
---|---|---|
other |
Returns
Type | Description |
---|---|
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 |
---|---|---|
obj |
Returns
Type | Description |
---|---|
Overrides
GetHashCode()
Represents a portion of an input stream, defined by a start position and a length.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Overrides
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 |
---|---|---|
builder |
Returns
Type | Description |
---|---|
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 |
---|---|---|
amount |
The amount by which to shift locations. |
Returns
Type | Description |
---|---|
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 |
---|---|
Overrides
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 |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|
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 |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|