+++ /dev/null
-/** @file\r
- \r
- The file is used to define Pcd 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.PcdCoded;\r
-\r
-import java.util.Vector;\r
-\r
-public class PcdVector {\r
-\r
- private Vector<PcdIdentification> vPcd = new Vector<PcdIdentification>();\r
-\r
- public int findPcd(PcdIdentification sfi) {\r
- for (int index = 0; index < vPcd.size(); index++) {\r
- if (vPcd.elementAt(index).equals(sfi)) {\r
- return index;\r
- }\r
- }\r
- return -1;\r
- }\r
-\r
- public int findPcd(String name) {\r
- for (int index = 0; index < vPcd.size(); index++) {\r
- if (vPcd.elementAt(index).getName().equals(name)) {\r
- return index;\r
- }\r
- }\r
- return -1;\r
- }\r
-\r
- public PcdIdentification getPcd(int index) {\r
- if (index > -1) {\r
- return vPcd.elementAt(index);\r
- } else {\r
- return null;\r
- }\r
- }\r
-\r
- public void addPcd(PcdIdentification arg0) {\r
- vPcd.addElement(arg0);\r
- }\r
-\r
- public void setPcd(PcdIdentification arg0, int arg1) {\r
- vPcd.setElementAt(arg0, arg1);\r
- }\r
-\r
- public void removePcd(PcdIdentification arg0) {\r
- int index = findPcd(arg0);\r
- if (index > -1) {\r
- vPcd.removeElementAt(index);\r
- }\r
- }\r
-\r
- public void removePcd(int index) {\r
- if (index > -1 && index < this.size()) {\r
- vPcd.removeElementAt(index);\r
- }\r
- }\r
-\r
- public Vector<PcdIdentification> getvPcd() {\r
- return vPcd;\r
- }\r
-\r
- public void setvPcd(Vector<PcdIdentification> Pcd) {\r
- vPcd = Pcd;\r
- }\r
-\r
- public Vector<String> getPcdName() {\r
- Vector<String> v = new Vector<String>();\r
- for (int index = 0; index < this.vPcd.size(); index++) {\r
- v.addElement(vPcd.get(index).getName());\r
- }\r
- return v;\r
- }\r
-\r
- public int size() {\r
- return this.vPcd.size();\r
- }\r
-\r
- public void addAll(PcdVector v) {\r
- if (v != null) {\r
- for (int index = 0; index < v.size(); index++) {\r
- vPcd.add(v.getPcd(index));\r
- }\r
- }\r
- }\r
-}\r