]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java
1. Restructure some folders and files
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / Identifications / LibraryClass / LibraryClassVector.java
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java
new file mode 100644 (file)
index 0000000..f7af757
--- /dev/null
@@ -0,0 +1,89 @@
+/** @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