Skip to content

T_CodeJam_OneOf_5

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

OneOf(T1, T2, T3, T4, T5) Class

Tagged union for 5 types.

Inheritance Hierarchy

System.Object
  CodeJam.OneOf(T1, T2, T3, T4, T5)
Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public abstract class OneOf<T1, T2, T3, T4, T5> : IOneOf<T1, T2, T3, T4, T5>, 
	IEquatable<OneOf<T1, T2, T3, T4, T5>>

VB

Public MustInherit Class OneOf(Of T1, T2, T3, T4, T5)
	Implements IOneOf(Of T1, T2, T3, T4, T5), IEquatable(Of OneOf(Of T1, T2, T3, T4, T5))

F#

[<AbstractClassAttribute>]
type OneOf<'T1, 'T2, 'T3, 'T4, 'T5> =  
    class
        interface IOneOf<'T1, 'T2, 'T3, 'T4, 'T5>
        interface IEquatable<OneOf<'T1, 'T2, 'T3, 'T4, 'T5>>
    end

Type Parameters

 

T1
Type of case 1
T2
Type of case 2
T3
Type of case 3
T4
Type of case 4
T5
Type of case 5
  The OneOf(T1, T2, T3, T4, T5) type exposes the following members.

Constructors

 

Name Description
Protected method OneOf(T1, T2, T3, T4, T5) Initializes a new instance of the OneOf(T1, T2, T3, T4, T5) class
  Back to Top

Properties

 

Name Description
Public property IsCase1 Returns true if class contains value of type T1.
Public property IsCase2 Returns true if class contains value of type T2.
Public property IsCase3 Returns true if class contains value of type T3.
Public property IsCase4 Returns true if class contains value of type T4.
Public property IsCase5 Returns true if class contains value of type T5.
  Back to Top

Methods

 

Name Description
Public methodStatic member Create(T1) Creates instance of OneOf(T1, T2, T3, T4, T5) for value of type T1.
Public methodStatic member Create(T2) Creates instance of OneOf(T1, T2, T3, T4, T5) for value of type T2.
Public methodStatic member Create(T3) Creates instance of OneOf(T1, T2, T3, T4, T5) for value of type T3.
Public methodStatic member Create(T4) Creates instance of OneOf(T1, T2, T3, T4, T5) for value of type T4.
Public methodStatic member Create(T5) Creates instance of OneOf(T1, T2, T3, T4, T5) for value of type T5.
Public method Do Calls action for actual type argument.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Overrides Object.Equals(Object).)
Public method Equals(OneOf(T1, T2, T3, T4, T5)) Indicates whether the current object is equal to another object of the same type.
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Overrides Object.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetValue(TResult) Calls func for actual type argument and returns calculated value.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
  Back to Top

Operators

 

Name Description
Public operatorStatic member Equality Equality operator.
Public operatorStatic member Implicit(T1 to OneOf(T1, T2, T3, T4, T5)) Implicit cast operator.
Public operatorStatic member Implicit(T2 to OneOf(T1, T2, T3, T4, T5)) Implicit cast operator.
Public operatorStatic member Implicit(T3 to OneOf(T1, T2, T3, T4, T5)) Implicit cast operator.
Public operatorStatic member Implicit(T4 to OneOf(T1, T2, T3, T4, T5)) Implicit cast operator.
Public operatorStatic member Implicit(T5 to OneOf(T1, T2, T3, T4, T5)) Implicit cast operator.
Public operatorStatic member Inequality Unequality operator.
  Back to Top

See Also

Reference

CodeJam Namespace

Clone this wiki locally