Mercurial > hg > Database > jungle-sharp
comparison src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle-main/data/treemap/EmptyNode.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 using UnityEngine; | |
2 using System.Collections; | |
3 using System.Collections.Generic; | |
4 using System; | |
5 | |
6 public class EmptyNode<K,V> : TreeMapNode<K,V>{ | |
7 //static V values; | |
8 // Use this for initialization | |
9 public EmptyNode () | |
10 : base (default(K),default(V)) | |
11 { | |
12 } | |
13 | |
14 public EmptyNode (K key) | |
15 : base (key,default(V)) | |
16 { | |
17 } | |
18 | |
19 public override TreeMapNode<K,V> lefts(){ | |
20 return new EmptyNode<K,V>(); | |
21 } | |
22 | |
23 public override TreeMapNode<K,V> rights(){ | |
24 return new EmptyNode<K,V>(); | |
25 } | |
26 | |
27 public override bool isNotEmpty(){ | |
28 return false; | |
29 } | |
30 | |
31 public override TreeMapNode<K,V> createNode(K key,V value,TreeMapNode<K,V> left, TreeMapNode<K,V> right){ | |
32 return new RedNode<K,V> (key, value, new EmptyNode<K,V> (), new EmptyNode<K,V> ()); | |
33 } | |
34 | |
35 public TreeMapNode<K,V> put(K k,V value){ | |
36 return new RedNode<K, V> (k, value, new EmptyNode<K,V> (), new EmptyNode<K,V> ()); | |
37 } | |
38 | |
39 //I don't know only Comparator method. | |
40 public override rebuildNode<K, V> replaceNode(TreeMapNode<K, V> parent, Comparer<K> ctr) { // not use method | |
41 return new rebuildNode<K,V>(false, this); | |
42 } | |
43 | |
44 public override rebuildNode<K,V> deleteNode(){ | |
45 return new rebuildNode<K, V> (false, this); | |
46 } | |
47 | |
48 public override TreeMapNode<K,V> insBalance(){ | |
49 return insBalance(); | |
50 } | |
51 | |
52 public override Rotate checkRotate(Rotate side){ | |
53 return Rotate.N; | |
54 } | |
55 | |
56 public override bool isRed(){ | |
57 return false; | |
58 } | |
59 | |
60 public override int checkDepth(int count, int minCount) { // test method | |
61 if (count < minCount || minCount == 0) { | |
62 minCount = count; | |
63 } | |
64 //c# is there assert?? | |
65 //Assert.assertTrue(count <= 2 * minCount); | |
66 return minCount; | |
67 } | |
68 | |
69 } |