Skip to content

T_CodeJam_Ranges_RangeBoundaryFrom_1

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

RangeBoundaryFrom(T) Structure

The From boundary of the range.

The From boundary of the range.

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

Syntax

C#

[SerializableAttribute]
public struct RangeBoundaryFrom<T> : IEquatable<RangeBoundaryFrom<T>>, 
	IComparable<RangeBoundaryFrom<T>>, IComparable<RangeBoundaryTo<T>>, IComparable<T>, 
	IComparable, IFormattable

VB

<SerializableAttribute>
Public Structure RangeBoundaryFrom(Of T)
	Implements IEquatable(Of RangeBoundaryFrom(Of T)), IComparable(Of RangeBoundaryFrom(Of T)), 
	IComparable(Of RangeBoundaryTo(Of T)), IComparable(Of T), IComparable, 
	IFormattable

F#

[<SealedAttribute>]
[<SerializableAttribute>]
type RangeBoundaryFrom<'T> =  
    struct
        interface IEquatable<RangeBoundaryFrom<'T>>
        interface IComparable<RangeBoundaryFrom<'T>>
        interface IComparable<RangeBoundaryTo<'T>>
        interface IComparable<'T>
        interface IComparable
        interface IFormattable
    end

Type Parameters

 

T
The type of the value. Should implement or .
  The RangeBoundaryFrom(T) type exposes the following members.

Constructors

 

Name Description
Public method RangeBoundaryFrom(T) Creates a new range boundary.
  Back to Top

Properties

 

Name Description
Public property HasValue The boundary has a value (is not an infinite boundary).
Public property IsEmpty The boundary == ∅.
Public property IsExclusiveBoundary The boundary has value (is not an infinite boundary) but does not include the value.
Public property IsInclusiveBoundary The boundary has value (is not an infinite boundary) and does include the value.
Public property IsNegativeInfinity The boundary == -∞.
Public property IsNotEmpty The boundary != ∅.
Public property Kind The kind of the boundary.
Public property Value The value of the boundary.
  Back to Top

Methods

 

Name Description
Public methodStatic member AdjustAndCreate Infrastructure helper method to create a boundary that handles default and infinite values. The boundaryKind should be either Inclusive or Exclusive
Public method CompareTo(T) Compares the current boundary with the value of another From boundary. Following order is used: '∅' < '-∞' < 'a)' < '[a' == 'a]' < '(a' < '+∞'.
Public method CompareTo(RangeBoundaryFrom(T)) Compares the current boundary with another one. Following order is used: '∅' < '-∞' < 'a)' < '[a' == 'a]' < '(a' < '+∞'.
Public method CompareTo(RangeBoundaryTo(T)) Compares the current boundary with another one. Following order is used: '∅' < '-∞' < 'a)' < '[a' == 'a]' < '(a' < '+∞'.
Public method Equals(Object) Indicates whether the current boundary and a specified object are equal. (Overrides ValueType.Equals(Object).)
Public method Equals(RangeBoundaryFrom(T)) Indicates whether the current boundary is equal to another.
Public method GetComplementation Returns complementation for the boundary. The conversions are: * 'a]' -> '(a' * '[a' -> 'a)' * 'a)' -> '[a' * '(a' -> 'a]' Empty or infinite boundaries will throw. Check the HasValue before calling the method.
Public method GetHashCode Returns the hash code for the current boundary. (Overrides ValueType.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetValueOrDefault() The value of the boundary or the default(T) if HasValue property equals to false.
Public method GetValueOrDefault(T) The value of the boundary or the defaultValue if HasValue property equals to false.
Public method IsComplementationFor Checks that the boundary is complementation for specified boundary.
Public methodStatic member IsValid Infrastructure helper method to check if the value can be used as the value of the boundary.
Public method ToExclusive Creates a new boundary with exclusive boundary kind if the current boundary has a value. The original boundary is returned otherwise.
Public method ToInclusive Creates a new boundary with inclusive boundary kind if the current boundary has a value. The original boundary is returned otherwise.
Public method ToString() Returns string representation of the boundary. (Overrides ValueType.ToString().)
Public method ToString(String) Returns string representation of the boundary 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 boundary using the specified format string. If T does not implement the format string is ignored
Public method WithValue(Func(T, T)) Creates a new boundary with updated value (if the current boundary has one). If the boundary has no value the method returns the boundary unchanged.
Public method WithValue(T2)(Func(T, T2)) Creates a new boundary with updated value (if the current boundary has one). If the boundary has no value the method returns the boundary unchanged.
  Back to Top

Operators

 

Name Description
Public operatorStatic member Equality Implements the operator ==.
Public operatorStatic member GreaterThan(T, RangeBoundaryFrom(T)) Implements the operator >.
Public operatorStatic member GreaterThan(RangeBoundaryFrom(T), RangeBoundaryFrom(T)) Implements the operator >.
Public operatorStatic member GreaterThan(RangeBoundaryFrom(T), RangeBoundaryTo(T)) Implements the operator >.
Public operatorStatic member GreaterThan(RangeBoundaryFrom(T), T) Implements the operator >.
Public operatorStatic member GreaterThanOrEqual(T, RangeBoundaryFrom(T)) Implements the operator >=.
Public operatorStatic member GreaterThanOrEqual(RangeBoundaryFrom(T), RangeBoundaryFrom(T)) Implements the operator >=.
Public operatorStatic member GreaterThanOrEqual(RangeBoundaryFrom(T), RangeBoundaryTo(T)) Implements the operator >=.
Public operatorStatic member GreaterThanOrEqual(RangeBoundaryFrom(T), T) Implements the operator >=.
Public operatorStatic member Inequality Implements the operator !=.
Public operatorStatic member LessThan(T, RangeBoundaryFrom(T)) Implements the operator <.
Public operatorStatic member LessThan(RangeBoundaryFrom(T), RangeBoundaryFrom(T)) Implements the operator <.
Public operatorStatic member LessThan(RangeBoundaryFrom(T), RangeBoundaryTo(T)) Implements the operator <.
Public operatorStatic member LessThan(RangeBoundaryFrom(T), T) Implements the operator <.
Public operatorStatic member LessThanOrEqual(T, RangeBoundaryFrom(T)) Implements the operator <=.
Public operatorStatic member LessThanOrEqual(RangeBoundaryFrom(T), RangeBoundaryFrom(T)) Implements the operator <=.
Public operatorStatic member LessThanOrEqual(RangeBoundaryFrom(T), RangeBoundaryTo(T)) Implements the operator <=.
Public operatorStatic member LessThanOrEqual(RangeBoundaryFrom(T), T) Implements the operator <=.
  Back to Top

Fields

 

Name Description
Public fieldStatic member Empty Empty range boundary, ∅.
Public fieldStatic member NegativeInfinity Negative infinity, -∞.
  Back to Top

Remarks

Heavy tuned to be as fast as it is possible. The order of borders is the following: '∅' < '-∞' < 'a)' < '[a' == 'a]' < '(a' < '+∞'.

See Also

Reference

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

Clone this wiki locally