comparison src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle-main/util/DefaultEither.cs @ 10:abe0c247f5a5

Add Network module. but, unComplete NetworkDefaultJungleTreeEditor.cs
author Kazuma Takeda <kazuma-arashi@hotmail.co.jp>
date Sun, 23 Oct 2016 07:40:50 +0900
parents
children
comparison
equal deleted inserted replaced
9:e6ad9016601c 10:abe0c247f5a5
1 
2 public class DefaultEither<A,B> : Either<A,B> {
3 private A theA;
4 private B theB;
5
6 private DefaultEither(A _theA, B _theB){
7 theA = _theA;
8 theB = _theB;
9 }
10
11 public static DefaultEither<A,B> newA(A _theA)
12 {
13 return new DefaultEither<A,B>(_theA,default(B));
14 }
15
16 public static DefaultEither<A,B> newB(B _theB)
17 {
18 return new DefaultEither<A,B>(default(A),_theB);
19 }
20
21 public A a()
22 {
23 return theA;
24 }
25
26
27 public bool isA()
28 {
29 return theA != null;
30 }
31
32
33 public B b()
34 {
35 return theB;
36 }
37
38
39 public bool isB()
40 {
41 return theB != null;
42 }
43
44 }