C# Class PutioFS.Core.LongRange

A class to represent a range of long values. Start is inclusive, End is exclusive.
Inheritance: IComparable
Afficher le fichier Open project: firat/PutioFS Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

CompareTo() public méthode

First compare the Start values, if they are equal, compare End values.
public CompareTo ( object obj ) : int
obj object
Résultat int

Contains() public méthode

Check if the range contains the given value.
public Contains ( long value ) : System.Boolean
value long
Résultat System.Boolean

Intersects() public méthode

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
Résultat System.Boolean

IsConsequent() public méthode

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
Résultat System.Boolean

LongRange() public méthode

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
Résultat System

Merge() public méthode

Merge this LongRange with a one that intersects it.
public Merge ( LongRange range ) : void
range LongRange
Résultat void

TryMerge() public méthode

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
Résultat System.Boolean