C# Класс PutioFS.Core.LongRange

A class to represent a range of long values. Start is inclusive, End is exclusive.
Наследование: IComparable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CompareTo ( object obj ) : int

First compare the Start values, if they are equal, compare End values.

Contains ( long value ) : System.Boolean

Check if the range contains the given value.

Intersects ( LongRange range ) : System.Boolean

Check if this object intersects with the given range. Start positions are inclusive and End positions are exclusive.

IsConsequent ( LongRange range ) : System.Boolean

Check if this objects comes RIGHT AFTER or RIGHT BEFORE the given range. That is. this.Start is equal to range.End or vice versa.

LongRange ( long start, long end ) : System

Never ever let a LongRange with an end value that is smaller than or equal to its start value

Merge ( LongRange range ) : void

Merge this LongRange with a one that intersects it.

TryMerge ( LongRange range ) : System.Boolean

Try to merge two Ranges. Do nothing if they are not consecutive or intersecting ranges. Return true if merged, false otherwise.

Описание методов

CompareTo() публичный Метод

First compare the Start values, if they are equal, compare End values.
public CompareTo ( object obj ) : int
obj object
Результат int

Contains() публичный Метод

Check if the range contains the given value.
public Contains ( long value ) : System.Boolean
value long
Результат System.Boolean

Intersects() публичный Метод

Check if this object intersects with the given range. Start positions are inclusive and End positions are exclusive.
public Intersects ( LongRange range ) : System.Boolean
range LongRange
Результат System.Boolean

IsConsequent() публичный Метод

Check if this objects comes RIGHT AFTER or RIGHT BEFORE the given range. That is. this.Start is equal to range.End or vice versa.
public IsConsequent ( LongRange range ) : System.Boolean
range LongRange
Результат System.Boolean

LongRange() публичный Метод

Never ever let a LongRange with an end value that is smaller than or equal to its start value
public LongRange ( long start, long end ) : System
start long
end long
Результат System

Merge() публичный Метод

Merge this LongRange with a one that intersects it.
public Merge ( LongRange range ) : void
range LongRange
Результат void

TryMerge() публичный Метод

Try to merge two Ranges. Do nothing if they are not consecutive or intersecting ranges. Return true if merged, false otherwise.
public TryMerge ( LongRange range ) : System.Boolean
range LongRange
Результат System.Boolean