Beispiel #1
0
 public static AbstractNumber AsNumber(this INumberOperation operation)
 {
     if (operation == null)
     {
         throw new ArgumentNullException(nameof(operation));
     }
     return(new AbstractNumber(operation));
 }
Beispiel #2
0
 public static IBinaryNumberOperation AsBinary(this INumberOperation operation)
 {
     if (operation == null)
     {
         throw new ArgumentNullException(nameof(operation));
     }
     return(new NullaryAsBinaryOperation(operation));
 }
Beispiel #3
0
 public AbstractNumber(INumberOperation operation)
 {
     if (operation == null)
     {
         throw new ArgumentNullException(nameof(operation));
     }
     this.operation = operation;
 }
Beispiel #4
0
 public static IUnaryNumberOperation Apply(this IBinaryNumberOperation outer, INumberOperation left, IUnaryNumberOperation right)
 {
     if (outer == null)
     {
         throw new ArgumentNullException(nameof(outer));
     }
     if (left == null)
     {
         throw new ArgumentNullException(nameof(left));
     }
     return(new BinaryNullaryUnaryOperation(outer, left, right));
 }
Beispiel #5
0
 public static INumberOperation Apply(this IUnaryNumberOperation outer, INumberOperation inner)
 {
     if (outer == null)
     {
         throw new ArgumentNullException(nameof(outer));
     }
     if (inner == null)
     {
         throw new ArgumentNullException(nameof(inner));
     }
     return(new UnaryStandardNumber(outer, inner));
 }
Beispiel #6
0
 public NullaryAsUnaryOperation(INumberOperation operation)
 {
     this.operation = operation;
 }