C# Class PutioFS.Core.LongRangeCollection

Show file Open project: firat/PutioFS Class Usage Examples

Public Properties

Property Type Description
Max long
Min long
RangeSet SortedSet

Public Methods

Method Description
AddRange ( long start, long end ) : void

Add the given range to the current collection.

BinaryIndexSearch ( long value ) : int

Do a binary search, returning the index of the LongRange containing the value.

BinarySearch ( long value ) : LongRange

Find and return the Range that includes the given value. Returns null no range includes the given value.

Bisect ( long value ) : int

Find the index where this value would fit in if it was in the range collection. The value should not already be in the collection.

Clone ( ) : LongRangeCollection
Contains ( long start, long end ) : System.Boolean

Checks if the given range is in the collection.

LongRangeCollection ( long min, long max ) : System

Method Details

AddRange() public method

Add the given range to the current collection.
public AddRange ( long start, long end ) : void
start long
end long
return void

BinaryIndexSearch() public method

Do a binary search, returning the index of the LongRange containing the value.
public BinaryIndexSearch ( long value ) : int
value long
return int

BinarySearch() public method

Find and return the Range that includes the given value. Returns null no range includes the given value.
public BinarySearch ( long value ) : LongRange
value long
return LongRange

Bisect() public method

Find the index where this value would fit in if it was in the range collection. The value should not already be in the collection.
public Bisect ( long value ) : int
value long
return int

Clone() public method

public Clone ( ) : LongRangeCollection
return LongRangeCollection

Contains() public method

Checks if the given range is in the collection.
public Contains ( long start, long end ) : System.Boolean
start long
end long
return System.Boolean

LongRangeCollection() public method

public LongRangeCollection ( long min, long max ) : System
min long
max long
return System

Property Details

Max public property

public long Max
return long

Min public property

public long Min
return long

RangeSet public property

public SortedSet RangeSet
return SortedSet