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
.Identifications
.Externs
;
17 import java
.util
.Vector
;
19 import org
.tianocore
.frameworkwizard
.common
.EnumerationData
;
21 public class ExternsVector
{
23 private Vector
<ExternsIdentification
> vExterns
= new Vector
<ExternsIdentification
>();
25 public int findExterns(ExternsIdentification sfi
) {
26 for (int index
= 0; index
< vExterns
.size(); index
++) {
27 if (vExterns
.elementAt(index
).equals(sfi
)) {
34 public int findExterns(String name
) {
35 for (int index
= 0; index
< vExterns
.size(); index
++) {
36 if (vExterns
.elementAt(index
).getName().equals(name
)) {
43 public ExternsIdentification
getExterns(int index
) {
45 return vExterns
.elementAt(index
);
51 public void addExterns(ExternsIdentification arg0
) {
52 boolean isExistPcd
= false;
53 if (arg0
.getType().equals(EnumerationData
.EXTERNS_PCD_IS_DRIVER
)) {
54 for (int index
= 0; index
< size(); index
++) {
55 if (getExterns(index
).getType().equals(EnumerationData
.EXTERNS_PCD_IS_DRIVER
)) {
56 setExterns(arg0
, index
);
62 vExterns
.addElement(arg0
);
65 vExterns
.addElement(arg0
);
69 public void setExterns(ExternsIdentification arg0
, int arg1
) {
70 vExterns
.setElementAt(arg0
, arg1
);
73 public void removeExterns(ExternsIdentification arg0
) {
74 int index
= findExterns(arg0
);
76 vExterns
.removeElementAt(index
);
80 public void removeExterns(int index
) {
81 if (index
> -1 && index
< this.size()) {
82 vExterns
.removeElementAt(index
);
86 public Vector
<ExternsIdentification
> getvExterns() {
90 public void setvExterns(Vector
<ExternsIdentification
> Externs
) {
94 public Vector
<String
> getExternsName() {
95 Vector
<String
> v
= new Vector
<String
>();
96 for (int index
= 0; index
< this.vExterns
.size(); index
++) {
97 v
.addElement(vExterns
.get(index
).getName());
103 return this.vExterns
.size();
106 public Vector
<String
> toStringVector(int index
) {
107 Vector
<String
> v
= new Vector
<String
>();
108 v
.addElement(getExterns(index
).getName());
109 v
.addElement(getExterns(index
).getType());