3 The file is used to define Library Class 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
.LibraryClass
;
17 import java
.util
.Vector
;
20 public class LibraryClassVector
{
21 private Vector
<LibraryClassIdentification
> vLibraryClass
= new Vector
<LibraryClassIdentification
>();
23 public int findLibraryClass(LibraryClassIdentification lib
) {
24 for (int index
= 0; index
< vLibraryClass
.size(); index
++) {
25 if (vLibraryClass
.elementAt(index
).equals(lib
)) {
32 public int findLibraryClass(String name
) {
33 for (int index
= 0; index
< vLibraryClass
.size(); index
++) {
34 if (vLibraryClass
.elementAt(index
).getLibraryClassName().equals(name
)) {
41 public LibraryClassIdentification
getLibraryClass(int index
) {
43 return vLibraryClass
.elementAt(index
);
49 public void addLibraryClass(LibraryClassIdentification lib
) {
50 vLibraryClass
.addElement(lib
);
53 public void updateLibraryClass(LibraryClassIdentification lib
, int index
) {
54 vLibraryClass
.setElementAt(lib
, index
);
57 public void removeLibraryClass(LibraryClassIdentification lib
) {
58 int index
= findLibraryClass(lib
);
60 vLibraryClass
.removeElementAt(index
);
64 public void removeLibraryClass(int index
) {
65 if (index
> -1 && index
< this.size()) {
66 vLibraryClass
.removeElementAt(index
);
70 public Vector
<LibraryClassIdentification
> getVLibraryClass() {
74 public void setVLibraryClass(Vector
<LibraryClassIdentification
> libraryClass
) {
75 vLibraryClass
= libraryClass
;
78 public Vector
<String
> getLibraryClassName() {
79 Vector
<String
> v
= new Vector
<String
>();
80 for (int index
= 0; index
< this.vLibraryClass
.size(); index
++) {
81 v
.addElement(vLibraryClass
.get(index
).getLibraryClassName());
87 return this.vLibraryClass
.size();
90 public Vector
<String
> toStringVector(int index
) {
91 Vector
<String
> v
= new Vector
<String
>();
92 v
.addElement(getLibraryClass(index
).getLibraryClassName());
93 v
.addElement(getLibraryClass(index
).getUsage());