Skip to content

DocumentOffset

Namespace: Hex1b.Documents

Assembly: Hex1b.dll

Represents an absolute character offset into a document.

csharp
public readonly struct DocumentOffset : IEquatable<DocumentOffset>, IComparable<DocumentOffset>

Implements

Constructors

DocumentOffset(int)

Parameters:

csharp
public DocumentOffset(int value)

Properties

Value

Returns: Int32

csharp
public int Value { get; }

Zero

Returns: DocumentOffset

csharp
public static DocumentOffset Zero { get; }

Methods

CompareTo(DocumentOffset)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameters:

Returns: Int32

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning Less than zero This instance precedes other in the sort order. Zero This instance occurs in the same position in the sort order as other. Greater than zero This instance follows other in the sort order.

csharp
public int CompareTo(DocumentOffset other)

Equals(DocumentOffset)

Indicates whether the current object is equal to another object of the same type.

Parameters:

Returns: Boolean

true if the current object is equal to the other parameter; otherwise, false.

csharp
public bool Equals(DocumentOffset other)

Equals(object?)

Indicates whether this instance and a specified object are equal.

Parameters:

  • obj (Object): The object to compare with the current instance.

Returns: Boolean

true if obj and this instance are the same type and represent the same value; otherwise, false.

csharp
public override bool Equals(object? obj)

GetHashCode()

Returns the hash code for this instance.

Returns: Int32

A 32-bit signed integer that is the hash code for this instance.

csharp
public override int GetHashCode()

ToString()

Returns the fully qualified type name of this instance.

Returns: String

The fully qualified type name.

csharp
public override string ToString()

Members

explicit operator DocumentOffset(int)

Parameters:

Returns: DocumentOffset

csharp
public static explicit operator DocumentOffset(int value)

implicit operator int(DocumentOffset)

Parameters:

Returns: Int32

csharp
public static implicit operator int(DocumentOffset offset)

operator -(DocumentOffset, DocumentOffset)

Parameters:

Returns: Int32

csharp
public static int operator -(DocumentOffset left, DocumentOffset right)

operator -(DocumentOffset, int)

Parameters:

Returns: DocumentOffset

csharp
public static DocumentOffset operator -(DocumentOffset left, int right)

operator !=(DocumentOffset, DocumentOffset)

Parameters:

Returns: Boolean

csharp
public static bool operator !=(DocumentOffset left, DocumentOffset right)

operator +(DocumentOffset, int)

Parameters:

Returns: DocumentOffset

csharp
public static DocumentOffset operator +(DocumentOffset left, int right)

operator <(DocumentOffset, DocumentOffset)

Parameters:

Returns: Boolean

csharp
public static bool operator <(DocumentOffset left, DocumentOffset right)

operator <=(DocumentOffset, DocumentOffset)

Parameters:

Returns: Boolean

csharp
public static bool operator <=(DocumentOffset left, DocumentOffset right)

operator ==(DocumentOffset, DocumentOffset)

Parameters:

Returns: Boolean

csharp
public static bool operator ==(DocumentOffset left, DocumentOffset right)

operator >(DocumentOffset, DocumentOffset)

Parameters:

Returns: Boolean

csharp
public static bool operator >(DocumentOffset left, DocumentOffset right)

operator >=(DocumentOffset, DocumentOffset)

Parameters:

Returns: Boolean

csharp
public static bool operator >=(DocumentOffset left, DocumentOffset right)

Released under the MIT License.