Skip to content

T_CodeJam_Ranges_CompositeRange_2

Andrew Koryavchenko edited this page Jun 17, 2018 · 3 revisions

CompositeRange(T, TKey) Structure

Describes a range of the values.

Describes a composite range that contains some subranges.

Namespace: CodeJam.Ranges
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

[SerializableAttribute]
public struct CompositeRange<T, TKey> : IEquatable<CompositeRange<T, TKey>>, 
	IFormattable

VB

<SerializableAttribute>
Public Structure CompositeRange(Of T, TKey)
	Implements IEquatable(Of CompositeRange(Of T, TKey)), 
	IFormattable

F#

[<SealedAttribute>]
[<SerializableAttribute>]
type CompositeRange<'T, 'TKey> =  
    struct
        interface IEquatable<CompositeRange<'T, 'TKey>>
        interface IFormattable
    end

Type Parameters

 

T
The type of the value. Should implement or .
TKey
The type of the range key
  The CompositeRange(T, TKey) type exposes the following members.

Constructors

 

Name Description
Public method CompositeRange(T, TKey)(Range(T, TKey)) Creates instance of .
Public method CompositeRange(T, TKey)(IEnumerable(Range(T, TKey))) Creates instance of .
  Back to Top

Properties

 

Name Description
Public property ContainingRange Range that contains all subranges.
Public property IsEmpty The composite range is empty, ∅.
Public property IsMerged The composite range cannot be simplified anymore. Subranges do not intersect and start one exactly after another.
Public property IsNotEmpty The composite range is NOT empty, ≠ ∅
Public property SubRanges Collection of subranges.
  Back to Top

Methods

 

Name Description
Public method Contains(T) Determines whether the composite range contains the specified value.
Public method Contains(CompositeRange(T)) Determines whether the composite range contains another range.
Public method Contains(Range(T)) Determines whether the composite range contains another range.
Public method Contains(RangeBoundaryFrom(T)) Determines whether the composite range contains the specified range boundary.
Public method Contains(RangeBoundaryTo(T)) Determines whether the composite range contains the specified range boundary.
Public method Contains(T, T) Determines whether the composite range contains another range.
Public method Contains(TKey2)(CompositeRange(T, TKey2)) Determines whether the composite range contains another range.
Public method Contains(TKey2)(Range(T, TKey2)) Determines whether the composite range contains another range.
Public method Equals(Object) Indicates whether the current range and a specified object are equal. (Overrides ValueType.Equals(Object).)
Public method Equals(CompositeRange(T, TKey)) Indicates whether the current range is equal to another.
Public method Except(CompositeRange(T)) Returns source range with other range excluded.
Public method Except(Range(T)) Returns source range with other range excluded.
Public method Except(T, T) Returns source range with other range excluded.
Public method Except(TKey2)(CompositeRange(T, TKey2)) Returns source range with other range excluded.
Public method Except(TKey2)(Range(T, TKey2)) Returns source range with other range excluded.
Public method ExtendFrom(T) Extends the range from the left.
Public method ExtendFrom(RangeBoundaryFrom(T)) Extends the range from the left.
Public method ExtendTo(T) Extends the range from the right.
Public method ExtendTo(RangeBoundaryTo(T)) Extends the range from the right.
Public method GetComplementation Returns complementation composite range. Result range contains result of (infinityRange.Exclude(this).
Public method GetHashCode Returns a hash code for the current range. (Overrides ValueType.GetHashCode().)
Public method GetIntersection(T) Returns ranges that has intersections with passed range.
Public method GetIntersection(Range(T)) Returns ranges that has intersections with passed range.
Public method GetIntersection(T, T) Returns ranges that has intersections with passed range.
Public method GetIntersection(TKey2)(Range(T, TKey2)) Returns ranges that has intersections with passed range.
Public method GetIntersections Returns all range intersections from the composite range.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method HasIntersection(CompositeRange(T)) Determines whether the composite range has intersection with another range.
Public method HasIntersection(Range(T)) Determines whether the composite range has intersection with another range.
Public method HasIntersection(T, T) Determines whether the composite has intersection with another range.
Public method HasIntersection(TKey2)(CompositeRange(T, TKey2)) Determines whether the composite range has intersection with another range.
Public method HasIntersection(TKey2)(Range(T, TKey2)) Determines whether the composite range has intersection with another range.
Public method Intersect(CompositeRange(T)) Returns an intersection of the the ranges.
Public method Intersect(Range(T)) Returns an intersection of the the ranges.
Public method Intersect(T, T) Returns an intersection of the the ranges.
Public method Intersect(TKey2)(CompositeRange(T, TKey2)) Returns an intersection of the the ranges.
Public method Intersect(TKey2)(Range(T, TKey2)) Returns an intersection of the the ranges.
Public method MakeExclusive Replaces inclusive boundaries with exclusive ones with the values from the selector callbacks
Public method MakeInclusive Replaces exclusive boundaries with inclusive ones with the values from the selector callbacks
Public method Merge Returns simplified composite range. Adjacent ranges with same keys will be merged.
Public method ToString() Returns string representation of the range. (Overrides ValueType.ToString().)
Public method ToString(IFormatProvider) Returns string representation of the range using the specified format string. If T does not implement the format string is ignored.
Public method ToString(String) Returns string representation of the range using the specified format string. If T does not implement the format string is ignored.
Public method ToString(String, IFormatProvider) Returns string representation of the range using the specified format string. If T does not implement the format string is ignored.
Public method TrimFrom(T) Trims the range from the left.
Public method TrimFrom(RangeBoundaryFrom(T)) Trims the range from the left.
Public method TrimTo(T) Trims the range from the right.
Public method TrimTo(RangeBoundaryTo(T)) Trims the range from the right.
Public method Union(CompositeRange(T, TKey)) Returns a union range containing all subranges.
Public method Union(Range(T, TKey)) Returns a union range containing all subranges.
Public method WithKeys(TKey2)(Func(TKey, TKey2)) Creates a new composite range with the key specified.
Public method WithKeys(TKey2)(TKey2) Creates a new composite range with the key specified.
Public method WithoutKeys Removes keys from the composite range.
Public method WithValues(T2)(Func(T, T2)) Creates a new composite range with the key specified.
Public method WithValues(T2)(Func(T, T2), Func(T, T2)) Creates a new composite range with the key specified.
  Back to Top

Operators

 

Name Description
Public operatorStatic member Equality Implements the operator ==.
Public operatorStatic member Inequality Implements the operator !=.
  Back to Top

Fields

 

Name Description
Public fieldStatic member Empty Empty range, ∅
Public fieldStatic member Infinite Infinite range, (-∞..+∞)
  Back to Top

See Also

Reference

CodeJam.Ranges Namespace
System.IComparable(T)
System.IComparable

Clone this wiki locally