]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/DataHubs/DataHubsVector.java
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@671 6f19259b...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / Identification / DataHubs / DataHubsVector.java
1 /** @file
2
3 The file is used to define Package Dependencies Vector
4
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
10
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.
13
14 **/
15 package org.tianocore.frameworkwizard.module.Identification.DataHubs;
16
17 import java.util.Vector;
18
19 public class DataHubsVector {
20
21 private Vector<DataHubsIdentification> vDataHubs = new Vector<DataHubsIdentification>();
22
23 public int findDataHubs(DataHubsIdentification sfi) {
24 for (int index = 0; index < vDataHubs.size(); index++) {
25 if (vDataHubs.elementAt(index).equals(sfi)) {
26 return index;
27 }
28 }
29 return -1;
30 }
31
32 public int findDataHubs(String name) {
33 for (int index = 0; index < vDataHubs.size(); index++) {
34 if (vDataHubs.elementAt(index).getName().equals(name)) {
35 return index;
36 }
37 }
38 return -1;
39 }
40
41 public DataHubsIdentification getDataHubs(int index) {
42 if (index > -1) {
43 return vDataHubs.elementAt(index);
44 } else {
45 return null;
46 }
47 }
48
49 public void addDataHubs(DataHubsIdentification arg0) {
50 vDataHubs.addElement(arg0);
51 }
52
53 public void updateDataHubs(DataHubsIdentification arg0, int arg1) {
54 vDataHubs.setElementAt(arg0, arg1);
55 }
56
57 public void removeDataHubs(DataHubsIdentification arg0) {
58 int index = findDataHubs(arg0);
59 if (index > -1) {
60 vDataHubs.removeElementAt(index);
61 }
62 }
63
64 public void removeDataHubs(int index) {
65 if (index > -1 && index < this.size()) {
66 vDataHubs.removeElementAt(index);
67 }
68 }
69
70 public Vector<DataHubsIdentification> getvDataHubs() {
71 return vDataHubs;
72 }
73
74 public void setvDataHubs(Vector<DataHubsIdentification> DataHubs) {
75 vDataHubs = DataHubs;
76 }
77
78 public Vector<String> getDataHubsName() {
79 Vector<String> v = new Vector<String>();
80 for (int index = 0; index < this.vDataHubs.size(); index++) {
81 v.addElement(vDataHubs.get(index).getName());
82 }
83 return v;
84 }
85
86 public int size() {
87 return this.vDataHubs.size();
88 }
89
90 }