| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Seasar.Framework.Container\Util\DestroyMethodDefSupport.cs | 75.0% | 90.0% | 100.0% | 89.5% |
|
1 | #region Copyright | |
2 | /* | |
3 | * Copyright 2005 the Seasar Foundation and the Others. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | |
14 | * either express or implied. See the License for the specific language | |
15 | * governing permissions and limitations under the License. | |
16 | */ | |
17 | #endregion | |
18 | ||
19 | using System; | |
20 | using System.Collections; | |
21 | ||
22 | namespace Seasar.Framework.Container.Util | |
23 | { | |
24 | /// <summary> | |
25 | /// DestroyMethodDefSupport の概要の説明です。 | |
26 | /// </summary> | |
27 | public sealed class DestroyMethodDefSupport | |
28 | { | |
29 | private IList methodDefs_ = ArrayList.Synchronized(new ArrayList()); | |
30 | private IS2Container container_; | |
31 | ||
32 | /// <summary> | |
33 | /// コンストラクタ | |
34 | /// </summary> | |
35 | 791 | public DestroyMethodDefSupport() |
36 | { | |
37 | } | |
38 | ||
39 | /// <summary> | |
40 | /// DestroyMethodDefを追加します。 | |
41 | /// </summary> | |
42 | /// <param name="methodDef">MethodDef</param> | |
43 | 10 | public void AddDestroyMethodDef(IDestroyMethodDef methodDef) |
44 | { | |
45 | 10 | if(container_ != null) |
46 | { | |
47 | 0 | methodDef.Container = container_; |
48 | } | |
49 | 10 | methodDefs_.Add(methodDef); |
50 | } | |
51 | ||
52 | /// <summary> | |
53 | /// DestroyMethodDefの数 | |
54 | /// </summary> | |
55 | public int DestroyMethodDefSize | |
56 | { | |
57 | 142 | get { return methodDefs_.Count; } |
58 | } | |
59 | ||
60 | /// <summary> | |
61 | /// 番号を指定してIDestroyMethodDefを取得します。 | |
62 | /// </summary> | |
63 | /// <param name="index">IDestroyMethodDefの番号</param> | |
64 | /// <returns>IDestroyMethodDef</returns> | |
65 | 10 | public IDestroyMethodDef GetDestroyMethodDef(int index) |
66 | { | |
67 | 10 | return (IDestroyMethodDef) methodDefs_[index]; |
68 | } | |
69 | ||
70 | /// <summary> | |
71 | /// S2Container | |
72 | /// </summary> | |
73 | public IS2Container Container | |
74 | { | |
75 | 788 | set |
76 | { | |
77 | 788 | container_ = value; |
78 | 788 | IEnumerator enu = methodDefs_.GetEnumerator(); |
79 | 797 | while(enu.MoveNext()) |
80 | { | |
81 | 9 | IDestroyMethodDef methodDef = (IDestroyMethodDef) enu.Current; |
82 | 9 | methodDef.Container = value; |
83 | } | |
84 | } | |
85 | } | |
86 | } | |
87 | } | |
88 |
|