]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/LibraryClass/LibraryClassVector.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 / LibraryClass / LibraryClassVector.java
CommitLineData
a13899c5 1/** @file\r
2 \r
3 The file is used to define Library Class Vector\r
4 \r
5 Copyright (c) 2006, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10 \r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13 \r
14 **/\r
15package org.tianocore.frameworkwizard.module.Identification.LibraryClass;\r
16\r
17import java.util.Vector;\r
18\r
19\r
20public class LibraryClassVector {\r
21 private Vector<LibraryClassIdentification> vLibraryClass = new Vector<LibraryClassIdentification>();\r
22 \r
23 public int findLibraryClass(LibraryClassIdentification lib) {\r
24 for (int index = 0; index < vLibraryClass.size(); index++) {\r
25 if (vLibraryClass.elementAt(index).equals(lib)) {\r
26 return index;\r
27 }\r
28 }\r
29 return -1;\r
30 }\r
31 \r
32 public int findLibraryClass(String name) {\r
33 for (int index = 0; index < vLibraryClass.size(); index++) {\r
34 if (vLibraryClass.elementAt(index).getLibraryClassName().equals(name)) {\r
35 return index;\r
36 }\r
37 }\r
38 return -1;\r
39 }\r
40 \r
41 public LibraryClassIdentification getLibraryClass(int index) {\r
42 if (index > -1) {\r
43 return vLibraryClass.elementAt(index);\r
44 } else {\r
45 return null;\r
46 }\r
47 }\r
48 \r
49 public void addLibraryClass(LibraryClassIdentification lib) {\r
50 vLibraryClass.addElement(lib);\r
51 }\r
52 \r
53 public void updateLibraryClass(LibraryClassIdentification lib, int index) {\r
54 vLibraryClass.setElementAt(lib, index);\r
55 }\r
56 \r
57 public void removeLibraryClass(LibraryClassIdentification lib) {\r
58 int index = findLibraryClass(lib);\r
59 if (index > -1) {\r
60 vLibraryClass.removeElementAt(index);\r
61 }\r
62 }\r
63 \r
64 public void removeLibraryClass(int index) {\r
65 if (index > -1 && index < this.size()) {\r
66 vLibraryClass.removeElementAt(index);\r
67 }\r
68 }\r
69\r
70 public Vector<LibraryClassIdentification> getVLibraryClass() {\r
71 return vLibraryClass;\r
72 }\r
73\r
74 public void setVLibraryClass(Vector<LibraryClassIdentification> libraryClass) {\r
75 vLibraryClass = libraryClass;\r
76 }\r
77 \r
78 public Vector<String> getLibraryClassName() {\r
79 Vector<String> v = new Vector<String>();\r
80 for (int index = 0; index < this.vLibraryClass.size(); index++) {\r
81 v.addElement(vLibraryClass.get(index).getLibraryClassName());\r
82 }\r
83 return v;\r
84 }\r
85 \r
86 public int size() {\r
87 return this.vLibraryClass.size();\r
88 }\r
89}\r