KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > datatype > TModelBag


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.juddi.datatype;
17
18 import java.util.Vector JavaDoc;
19
20 /**
21  * "Knows about the creation and populating of TModelBag objects.
22  * Returns TModelBag."
23  *
24  * @author Steve Viens (sviens@apache.org)
25  */

26 public class TModelBag implements RegistryObject
27 {
28   Vector JavaDoc tModelKeyVector;
29
30   /**
31    *
32    */

33   public TModelBag()
34   {
35   }
36
37   /**
38    *
39    */

40   public TModelBag(int size)
41   {
42     this.tModelKeyVector = new Vector JavaDoc(size);
43   }
44
45   /**
46    *
47    */

48   public void addTModelKey(TModelKey key)
49   {
50     if ((key != null) && (key.getValue() != null))
51       this.addTModelKey(key.getValue());
52   }
53
54   /**
55    *
56    */

57   public void addTModelKey(String JavaDoc key)
58   {
59     if (this.tModelKeyVector == null)
60       this.tModelKeyVector = new Vector JavaDoc();
61     this.tModelKeyVector.add(key);
62   }
63
64   /**
65    *
66    */

67   public void setTModelKeyVector(Vector JavaDoc keyVector)
68   {
69     this.tModelKeyVector = keyVector;
70   }
71
72   /**
73    *
74    */

75   public Vector JavaDoc getTModelKeyVector()
76   {
77     return this.tModelKeyVector;
78   }
79
80   /**
81    *
82    */

83   public int size()
84   {
85     if (this.tModelKeyVector != null)
86       return this.tModelKeyVector.size();
87     else
88       return 0;
89   }
90 }
Popular Tags