+++ /dev/null
-/** @file\r
- \r
- The file is used to define PcdCoded 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 PcdCodedVector {\r
-\r
- private Vector<PcdCodedIdentification> vPcdCoded = new Vector<PcdCodedIdentification>();\r
-\r
- public int findPcdCoded(PcdCodedIdentification sfi) {\r
- for (int index = 0; index < vPcdCoded.size(); index++) {\r
- if (vPcdCoded.elementAt(index).equals(sfi)) {\r
- return index;\r
- }\r
- }\r
- return -1;\r
- }\r
-\r
- public int findPcdCoded(String name) {\r
- for (int index = 0; index < vPcdCoded.size(); index++) {\r
- if (vPcdCoded.elementAt(index).getName().equals(name)) {\r
- return index;\r
- }\r
- }\r
- return -1;\r
- }\r
-\r
- public PcdCodedIdentification getPcdCoded(int index) {\r
- if (index > -1) {\r
- return vPcdCoded.elementAt(index);\r
- } else {\r
- return null;\r
- }\r
- }\r
-\r
- public void addPcdCoded(PcdCodedIdentification arg0) {\r
- vPcdCoded.addElement(arg0);\r
- }\r
-\r
- public void setPcdCoded(PcdCodedIdentification arg0, int arg1) {\r
- vPcdCoded.setElementAt(arg0, arg1);\r
- }\r
-\r
- public void removePcdCoded(PcdCodedIdentification arg0) {\r
- int index = findPcdCoded(arg0);\r
- if (index > -1) {\r
- vPcdCoded.removeElementAt(index);\r
- }\r
- }\r
-\r
- public void removePcdCoded(int index) {\r
- if (index > -1 && index < this.size()) {\r
- vPcdCoded.removeElementAt(index);\r
- }\r
- }\r
-\r
- public Vector<PcdCodedIdentification> getvPcdCoded() {\r
- return vPcdCoded;\r
- }\r
-\r
- public void setvPcdCoded(Vector<PcdCodedIdentification> PcdCoded) {\r
- vPcdCoded = PcdCoded;\r
- }\r
-\r
- public Vector<String> getPcdCodedName() {\r
- Vector<String> v = new Vector<String>();\r
- for (int index = 0; index < this.vPcdCoded.size(); index++) {\r
- v.addElement(vPcdCoded.get(index).getName());\r
- }\r
- return v;\r
- }\r
-\r
- public int size() {\r
- return this.vPcdCoded.size();\r
- }\r
-\r
- public Vector<String> toStringVector(int index) {\r
- Vector<String> v = new Vector<String>();\r
- v.addElement(getPcdCoded(index).getName());\r
- v.addElement(getPcdCoded(index).getType());\r
- v.addElement(getPcdCoded(index).getValue());\r
- v.addElement(getPcdCoded(index).getUsage());\r
- return v;\r
- }\r
-}\r