+++ /dev/null
-/** @file\r
- \r
- The file is used to define Boot Modes 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.BootModes;\r
-\r
-import java.util.Vector;\r
-\r
-public class BootModesVector {\r
-\r
- private Vector<BootModesIdentification> vBootModes = new Vector<BootModesIdentification>();\r
-\r
- public int findBootModes(BootModesIdentification sfi) {\r
- for (int index = 0; index < vBootModes.size(); index++) {\r
- if (vBootModes.elementAt(index).equals(sfi)) {\r
- return index;\r
- }\r
- }\r
- return -1;\r
- }\r
-\r
- public int findBootModes(String name) {\r
- for (int index = 0; index < vBootModes.size(); index++) {\r
- if (vBootModes.elementAt(index).getName().equals(name)) {\r
- return index;\r
- }\r
- }\r
- return -1;\r
- }\r
-\r
- public BootModesIdentification getBootModes(int index) {\r
- if (index > -1) {\r
- return vBootModes.elementAt(index);\r
- } else {\r
- return null;\r
- }\r
- }\r
-\r
- public void addBootModes(BootModesIdentification arg0) {\r
- vBootModes.addElement(arg0);\r
- }\r
-\r
- public void setBootModes(BootModesIdentification arg0, int arg1) {\r
- vBootModes.setElementAt(arg0, arg1);\r
- }\r
-\r
- public void removeBootModes(BootModesIdentification arg0) {\r
- int index = findBootModes(arg0);\r
- if (index > -1) {\r
- vBootModes.removeElementAt(index);\r
- }\r
- }\r
-\r
- public void removeBootModes(int index) {\r
- if (index > -1 && index < this.size()) {\r
- vBootModes.removeElementAt(index);\r
- }\r
- }\r
-\r
- public Vector<BootModesIdentification> getvBootModes() {\r
- return vBootModes;\r
- }\r
-\r
- public void setvBootModes(Vector<BootModesIdentification> BootModes) {\r
- vBootModes = BootModes;\r
- }\r
-\r
- public Vector<String> getBootModesName() {\r
- Vector<String> v = new Vector<String>();\r
- for (int index = 0; index < this.vBootModes.size(); index++) {\r
- v.addElement(vBootModes.get(index).getName());\r
- }\r
- return v;\r
- }\r
-\r
- public int size() {\r
- return this.vBootModes.size();\r
- }\r
- \r
- public Vector<String> toStringVector(int index) {\r
- Vector<String> v = new Vector<String>();\r
- v.addElement(getBootModes(index).getName());\r
- v.addElement(getBootModes(index).getUsage());\r
- return v;\r
- }\r
-}\r