Class SegmentPosition
Represents a position within a segment.
Inherited Members
Namespace: Sdl.Core.Bcm.BcmModel.Tokenization
Assembly: Sdl.Core.Bcm.BcmModel.dll
Syntax
[DataContract]
public class SegmentPosition : ExtensionDataContainer
Constructors
SegmentPosition()
Initializes a new instance of the SegmentPosition class.
Declaration
public SegmentPosition()
SegmentPosition(int, int)
Initializes a new instance with the specified arguments.
Declaration
public SegmentPosition(int runIndex, int positionInRun)
Parameters
| Type | Name | Description |
|---|---|---|
| int | runIndex | The index of the segment element within the segment. |
| int | positionInRun | The position within the run. This is only relevant for MediaTypeNames.Text elements, and has no effect for other segment element types. |
Properties
PositionInRun
Gets or sets the position within the subsegment.
Declaration
[DataMember(Name = "positionInRun")]
public int PositionInRun { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
RunIndex
Gets or sets the index of the run (segment element) within the segment.
Declaration
[DataMember(Name = "runIndex")]
public int RunIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
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 |
|---|---|
| int | 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)
System.Object.Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of the object, for display purposes. |