DocumentPosition
Namespace: Hex1b.Documents
Assembly: Hex1b.dll
Represents a line and column position in a document. Both are 1-based.
public readonly struct DocumentPosition : IEquatable<DocumentPosition>, IComparable<DocumentPosition>Implements
Constructors
DocumentPosition(int, int)
Parameters:
public DocumentPosition(int line, int column)Properties
Column
Returns: Int32
public int Column { get; }Line
Returns: Int32
public int Line { get; }Methods
CompareTo(DocumentPosition)
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(DocumentPosition): 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(DocumentPosition other)Equals(DocumentPosition)
Indicates whether the current object is equal to another object of the same type.
Parameters:
other(DocumentPosition): 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(DocumentPosition 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
operator !=(DocumentPosition, DocumentPosition)
Parameters:
left(DocumentPosition):right(DocumentPosition):
Returns: Boolean
public static bool operator !=(DocumentPosition left, DocumentPosition right)operator <(DocumentPosition, DocumentPosition)
Parameters:
left(DocumentPosition):right(DocumentPosition):
Returns: Boolean
public static bool operator <(DocumentPosition left, DocumentPosition right)operator <=(DocumentPosition, DocumentPosition)
Parameters:
left(DocumentPosition):right(DocumentPosition):
Returns: Boolean
public static bool operator <=(DocumentPosition left, DocumentPosition right)operator ==(DocumentPosition, DocumentPosition)
Parameters:
left(DocumentPosition):right(DocumentPosition):
Returns: Boolean
public static bool operator ==(DocumentPosition left, DocumentPosition right)operator >(DocumentPosition, DocumentPosition)
Parameters:
left(DocumentPosition):right(DocumentPosition):
Returns: Boolean
public static bool operator >(DocumentPosition left, DocumentPosition right)operator >=(DocumentPosition, DocumentPosition)
Parameters:
left(DocumentPosition):right(DocumentPosition):
Returns: Boolean
public static bool operator >=(DocumentPosition left, DocumentPosition right)