--- /dev/null
+/** @file\r
+ \r
+ The file is used to define Library Class Vector\r
+ \r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ \r
+ **/\r
+package org.tianocore.frameworkwizard.module.Identifications.LibraryClass;\r
+\r
+import java.util.Vector;\r
+\r
+\r
+public class LibraryClassVector {\r
+ private Vector<LibraryClassIdentification> vLibraryClass = new Vector<LibraryClassIdentification>();\r
+ \r
+ public int findLibraryClass(LibraryClassIdentification lib) {\r
+ for (int index = 0; index < vLibraryClass.size(); index++) {\r
+ if (vLibraryClass.elementAt(index).equals(lib)) {\r
+ return index;\r
+ }\r
+ }\r
+ return -1;\r
+ }\r
+ \r
+ public int findLibraryClass(String name) {\r
+ for (int index = 0; index < vLibraryClass.size(); index++) {\r
+ if (vLibraryClass.elementAt(index).getLibraryClassName().equals(name)) {\r
+ return index;\r
+ }\r
+ }\r
+ return -1;\r
+ }\r
+ \r
+ public LibraryClassIdentification getLibraryClass(int index) {\r
+ if (index > -1) {\r
+ return vLibraryClass.elementAt(index);\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+ \r
+ public void addLibraryClass(LibraryClassIdentification lib) {\r
+ vLibraryClass.addElement(lib);\r
+ }\r
+ \r
+ public void updateLibraryClass(LibraryClassIdentification lib, int index) {\r
+ vLibraryClass.setElementAt(lib, index);\r
+ }\r
+ \r
+ public void removeLibraryClass(LibraryClassIdentification lib) {\r
+ int index = findLibraryClass(lib);\r
+ if (index > -1) {\r
+ vLibraryClass.removeElementAt(index);\r
+ }\r
+ }\r
+ \r
+ public void removeLibraryClass(int index) {\r
+ if (index > -1 && index < this.size()) {\r
+ vLibraryClass.removeElementAt(index);\r
+ }\r
+ }\r
+\r
+ public Vector<LibraryClassIdentification> getVLibraryClass() {\r
+ return vLibraryClass;\r
+ }\r
+\r
+ public void setVLibraryClass(Vector<LibraryClassIdentification> libraryClass) {\r
+ vLibraryClass = libraryClass;\r
+ }\r
+ \r
+ public Vector<String> getLibraryClassName() {\r
+ Vector<String> v = new Vector<String>();\r
+ for (int index = 0; index < this.vLibraryClass.size(); index++) {\r
+ v.addElement(vLibraryClass.get(index).getLibraryClassName());\r
+ }\r
+ return v;\r
+ }\r
+ \r
+ public int size() {\r
+ return this.vLibraryClass.size();\r
+ }\r
+}\r