Search Results for

    Show / Hide Table of Contents

    Class SegmentRange

    A selection of content inside a Segment.

    Inheritance
    object
    ExtensionDataContainer
    SegmentRange
    Inherited Members
    ExtensionDataContainer.ExtensionData
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: Sdl.Core.Bcm.BcmModel.Tokenization
    Assembly: Sdl.Core.Bcm.BcmModel.dll
    Syntax
    [DataContract]
    public class SegmentRange : ExtensionDataContainer

    Constructors

    SegmentRange()

    Initializes a new instance of the SegmentRange class.

    Declaration
    public SegmentRange()

    SegmentRange(SegmentPosition, SegmentPosition)

    Initializes a new instance with the provided positions.

    Declaration
    public SegmentRange(SegmentPosition from, SegmentPosition into)
    Parameters
    Type Name Description
    SegmentPosition from

    The start position.

    SegmentPosition into

    The end position.

    Remarks

    No checks are performed to verify that the start position precedes the end position.

    SegmentRange(int, int, int)

    Initializes a new instance of with the given parameters.

    Declaration
    public SegmentRange(int runIndex, int fromIndex, int intoIndex)
    Parameters
    Type Name Description
    int runIndex

    The segment element index (run) of the range.

    int fromIndex

    The start position in the run.

    int intoIndex

    The end position (inclusive) in the run.

    Properties

    From

    Gets or sets the start SegmentPosition in the segment.

    Declaration
    [DataMember(Name = "from")]
    public SegmentPosition From { get; set; }
    Property Value
    Type Description
    SegmentPosition

    The start SegmentPosition in the segment.

    Into

    Gets or sets the end SegmentPosition in the segment.

    Declaration
    [DataMember(Name = "into")]
    public SegmentPosition Into { get; set; }
    Property Value
    Type Description
    SegmentPosition

    The end SegmentPosition in the segment.

    Methods

    Clone()

    Creates a new instance that is a deep copy of this instance.

    Declaration
    public SegmentRange Clone()
    Returns
    Type Description
    SegmentRange

    A new instance that is a deep copy of this instance.

    Compare(SegmentRange, SegmentRange)

    Compares two segment ranges and returns a value indicating their order.

    Declaration
    public static int Compare(SegmentRange a, SegmentRange b)
    Parameters
    Type Name Description
    SegmentRange a

    The first of the two items to compare.

    SegmentRange b

    The second of the two items to compare.

    Returns
    Type Description
    int

    An integer value less than zero if a precedes b, zero if a and b are in the same range, and a value greater than zero if a follows b. Only the start positions are compared.

    Equals(SegmentRange)

    Compares the current range to another segment range.

    Declaration
    public bool Equals(SegmentRange other)
    Parameters
    Type Name Description
    SegmentRange other

    The range to compare with.

    Returns
    Type Description
    bool

    true if both ranges are identical.

    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
    object.Equals(object)

    GetHashCode()

    System.Object.GetHashCode(object)

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    ToString()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of the object, for display purposes.

    Overrides
    object.ToString()
    In this article
    Back to top Generated by DocFX