Class SegmentPosition
Represents a position within a segment.
Inherited Members
Namespace: Sdl.Core.Bcm.BcmModel.Tokenization
Assembly: Sdl.Core.Bcm.BcmModel.dll
Syntax
public class SegmentPosition : ExtensionDataContainer
Constructors
SegmentPosition()
Initializes a new instance of the SegmentPosition class.
Declaration
public SegmentPosition()
SegmentPosition(Int32, Int32)
Initializes a new instance with the specified arguments.
Declaration
public SegmentPosition(int runIndex, int positionInRun)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | runIndex | The index of the segment element within the segment. |
System.Int32 | positionInRun | The position within the run. This is only relevant for System.Net.Mime.MediaTypeNames.Text elements, and has no effect for other segment element types. |
Properties
PositionInRun
Gets or sets the position within the subsegment.
Declaration
public int PositionInRun { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
RunIndex
Gets or sets the index of the run (segment element) within the segment.
Declaration
public int RunIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Clone()
Creates a new instance that is a deep copy of this instance.
Declaration
public SegmentPosition Clone()
Returns
Type | Description |
---|---|
SegmentPosition | A new instance that is a deep copy of this instance. |
Compare(SegmentPosition, SegmentPosition)
Compares two segment positions and returns an indication of their sort order.
Declaration
public static int Compare(SegmentPosition a, SegmentPosition b)
Parameters
Type | Name | Description |
---|---|---|
SegmentPosition | a | The first of the two items to compare. |
SegmentPosition | b | The second of the two items to compare. |
Returns
Type | Description |
---|---|
System.Int32 | An int value less than zero if a precedes b, zero if a denotes the same position as b, and greater than zero if a follows b. |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified object is equal to the current object; otherwise, false. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of the object, for display purposes. |