Enhanced C#
Language of your choice: library documentation

Documentation moved to ecsharp.net

GitHub doesn't support HTTP redirects, so you'll be redirected in 3 seconds.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Properties | Public Member Functions | List of all members
Loyc.Collections.IBRangeEx< R, T > Interface Template Reference

A bidirectional range that can perform operations such as intersection and overlap tests on pairs of ranges of the same type. More...


Source file:
Inheritance diagram for Loyc.Collections.IBRangeEx< R, T >:
Loyc.Collections.IBRange< out T > Loyc.Collections.IFRange< out T > Loyc.ICloneable< out T > Loyc.ICloneable< out T > Loyc.Collections.IIsEmpty Loyc.Collections.IBRangeEx< T > Loyc.Collections.IRangeEx< R, T > Loyc.Collections.IRangeEx< T >

Remarks

A bidirectional range that can perform operations such as intersection and overlap tests on pairs of ranges of the same type.

Template Parameters
RThe type that implements this interface
TThe type of elements in the range
Type Constraints
R :IBRangeEx 
R :R 
R :T 
R :ICloneable<R> 

Properties

IEnumerable< T > InnerList [get]
 Gets the list upon which this range is based. More...
 
int SliceStart [get]
 Index where this range starts within the InnerList. More...
 
- Properties inherited from Loyc.Collections.IBRange< out T >
Back [get]
 Returns the value of the last item in the range. More...
 
- Properties inherited from Loyc.Collections.IFRange< out T >
Front [get]
 Returns the first value in the range, without popping it. More...
 
- Properties inherited from Loyc.Collections.IIsEmpty
bool IsEmpty [get]
 

Public Member Functions

Intersect (R other)
 Gets the region of overlap between two ranges. More...
 
Union (R other)
 Gets a range just large enough to contain both ranges. More...
 
- Public Member Functions inherited from Loyc.Collections.IBRange< out T >
PopBack (out bool fail)
 Removes the last item from the range and returns it. More...
 
- Public Member Functions inherited from Loyc.Collections.IFRange< out T >
PopFront (out bool fail)
 Removes the first item from the range and returns it. More...
 
- Public Member Functions inherited from Loyc.ICloneable< out T >
Clone ()
 

Member Function Documentation

R Loyc.Collections.IBRangeEx< R, T >.Intersect ( other)

Gets the region of overlap between two ranges.

If the ranges do not overlap, an empty range is returned with InnerList set to the same value that this range has.

R Loyc.Collections.IBRangeEx< R, T >.Union ( other)

Gets a range just large enough to contain both ranges.

Exceptions
InvalidOperationExceptionThe two ranges cannot be combined because they have different InnerList values.

As long as both ranges are based on the same list, this method succeeds. For example, if one range covers 5..6 and the other range covers 10..20, the union covers 5..20.

Property Documentation

IEnumerable<T> Loyc.Collections.IBRangeEx< R, T >.InnerList
get

Gets the list upon which this range is based.

The return type is IEnumerable{T} since the available list interfaces may vary, e.g. it might be ICollection{T} or IListSource{T}.

int Loyc.Collections.IBRangeEx< R, T >.SliceStart
get

Index where this range starts within the InnerList.