GH_IndexRange

References
Represents a range of indices.

Constructors

GH_IndexRange

#
Create a new singular range.
public GH_IndexRange(
index
Index of range start and end.
)

GH_IndexRange

#
Create a new range.
public GH_IndexRange(
index0,
First index in range.
index1
Last index in range.
)

Properties

Index0

#
Gets the first index in the range.
public int Index0 { get; }

Index1

#
Gets the last index in the range.
public int Index1 { get; }

InvalidRange

#
Gets the predefined invalid range.
public static GH_IndexRange InvalidRange { get; }

IsSingular

#
Gets whether the range has zero length.
public bool IsSingular { get; }

IsValid

#
Gets whether this range is valid.
public bool IsValid { get; }

Length

#
Gets the length of the range.
public int Length { get; }

MaxValue

#
public static GH_IndexRange MaxValue { get; }

Methods

AdjacentTo

#
Tests whether this range is adjacent to another.
public bool AdjacentTo(
range
Range to test.
)
True if the ranges are adjacent and not intersecting.

Contains

#
Tests whether a specified range is entirely contained within this range.
public bool Contains(
range
Range to test.
)
True if the range is inside this one.

Contains

#
Tests whether a specified index is defined by this range.
public bool Contains(
index
Index to test.
)
True if the index is inside this range.

Intersection

#
Create the intersection between two ranges.
public static GH_IndexRange Intersection(
range0,
First range to intersect.
range1
Second range to intersect.
)
The intersection or an invalid range if the input doesn't intersect.

IntersectsWith

#
Tests whether certain indices are described by both this and another range.
public bool IntersectsWith(
range
Range to intersect with.
)
True if the ranges intersect.

Read

#
Read

Split

#
Split a range into two using an integer index.
public static int Split(
range,
Range to split.
splitter,
Range to split with.
result0,
First split result if successful, or an invalid range if not.
result1
Second split result if successful, or an invalid range if not.
)
The number of valid split results.

ToString

#
public override string ToString()

Union

#
Create a range which contains both input ranges.
public static GH_IndexRange Union()
Smallest range big enough to contain both range0 and range1.

Write

#
[EditorBrowsable(EditorBrowsableState.Never)] public bool Write(
writer
)
Write