DocumentOffset
Namespace: Hex1b.Documents
Assembly: Hex1b.dll
Represents an absolute character offset into a document.
public readonly struct DocumentOffset : IEquatable<DocumentOffset>, IComparable<DocumentOffset>Implements
Constructors
DocumentOffset(int)
Parameters:
value(Int32):
public DocumentOffset(int value)Properties
Value
Returns: Int32
public int Value { get; }Zero
Returns: DocumentOffset
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:
other(DocumentOffset): An object to compare with this instance.
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.
public int CompareTo(DocumentOffset other)Equals(DocumentOffset)
Indicates whether the current object is equal to another object of the same type.
Parameters:
other(DocumentOffset): An object to compare with this object.
Returns: Boolean
true if the current object is equal to the other parameter; otherwise, false.
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.
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.
public override int GetHashCode()ToString()
Returns the fully qualified type name of this instance.
Returns: String
The fully qualified type name.
public override string ToString()Members
explicit operator DocumentOffset(int)
Parameters:
value(Int32):
Returns: DocumentOffset
public static explicit operator DocumentOffset(int value)implicit operator int(DocumentOffset)
Parameters:
offset(DocumentOffset):
Returns: Int32
public static implicit operator int(DocumentOffset offset)operator -(DocumentOffset, DocumentOffset)
Parameters:
left(DocumentOffset):right(DocumentOffset):
Returns: Int32
public static int operator -(DocumentOffset left, DocumentOffset right)operator -(DocumentOffset, int)
Parameters:
left(DocumentOffset):right(Int32):
Returns: DocumentOffset
public static DocumentOffset operator -(DocumentOffset left, int right)operator !=(DocumentOffset, DocumentOffset)
Parameters:
left(DocumentOffset):right(DocumentOffset):
Returns: Boolean
public static bool operator !=(DocumentOffset left, DocumentOffset right)operator +(DocumentOffset, int)
Parameters:
left(DocumentOffset):right(Int32):
Returns: DocumentOffset
public static DocumentOffset operator +(DocumentOffset left, int right)operator <(DocumentOffset, DocumentOffset)
Parameters:
left(DocumentOffset):right(DocumentOffset):
Returns: Boolean
public static bool operator <(DocumentOffset left, DocumentOffset right)operator <=(DocumentOffset, DocumentOffset)
Parameters:
left(DocumentOffset):right(DocumentOffset):
Returns: Boolean
public static bool operator <=(DocumentOffset left, DocumentOffset right)operator ==(DocumentOffset, DocumentOffset)
Parameters:
left(DocumentOffset):right(DocumentOffset):
Returns: Boolean
public static bool operator ==(DocumentOffset left, DocumentOffset right)operator >(DocumentOffset, DocumentOffset)
Parameters:
left(DocumentOffset):right(DocumentOffset):
Returns: Boolean
public static bool operator >(DocumentOffset left, DocumentOffset right)operator >=(DocumentOffset, DocumentOffset)
Parameters:
left(DocumentOffset):right(DocumentOffset):
Returns: Boolean
public static bool operator >=(DocumentOffset left, DocumentOffset right)