3 The file is used to define Package Dependencies Vector
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 package org
.tianocore
.frameworkwizard
.module
.Identification
.Protocols
;
17 import java
.util
.Vector
;
19 public class ProtocolsVector
{
21 private Vector
<ProtocolsIdentification
> vProtocols
= new Vector
<ProtocolsIdentification
>();
23 public int findProtocols(ProtocolsIdentification sfi
) {
24 for (int index
= 0; index
< vProtocols
.size(); index
++) {
25 if (vProtocols
.elementAt(index
).equals(sfi
)) {
32 public int findProtocols(String name
) {
33 for (int index
= 0; index
< vProtocols
.size(); index
++) {
34 if (vProtocols
.elementAt(index
).getName().equals(name
)) {
41 public ProtocolsIdentification
getProtocols(int index
) {
43 return vProtocols
.elementAt(index
);
49 public void addProtocols(ProtocolsIdentification arg0
) {
50 vProtocols
.addElement(arg0
);
53 public void updateProtocols(ProtocolsIdentification arg0
, int arg1
) {
54 vProtocols
.setElementAt(arg0
, arg1
);
57 public void removeProtocols(ProtocolsIdentification arg0
) {
58 int index
= findProtocols(arg0
);
60 vProtocols
.removeElementAt(index
);
64 public void removeProtocols(int index
) {
65 if (index
> -1 && index
< this.size()) {
66 vProtocols
.removeElementAt(index
);
70 public Vector
<ProtocolsIdentification
> getvProtocols() {
74 public void setvProtocols(Vector
<ProtocolsIdentification
> Protocols
) {
75 vProtocols
= Protocols
;
78 public Vector
<String
> getProtocolsName() {
79 Vector
<String
> v
= new Vector
<String
>();
80 for (int index
= 0; index
< this.vProtocols
.size(); index
++) {
81 v
.addElement(vProtocols
.get(index
).getName());
87 return this.vProtocols
.size();