1. Add pcd item Identifications used by select pcd entry when editing pcd in msa

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@997 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2006-07-14 05:45:53 +00:00
parent 9a8d6d9fb7
commit 985384609e
2 changed files with 171 additions and 0 deletions

View File

@ -0,0 +1,74 @@
/** @file
The file is used to define Pcd Item Identification
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
import java.util.Vector;
public class PcdIdentification {
//
// Define class members
//
private String name = null;
private String guidCName = null;
private String help = null;
private Vector<String> type = null;
public PcdIdentification(String arg0, String arg1, String arg2, Vector<String> arg3) {
this.name = (arg0 == null ? "" : arg0);
this.guidCName = (arg1 == null ? "" : arg1);
this.help = (arg2 == null ? "" : arg2);
this.type = arg3;
}
public String getHelp() {
return help;
}
public void setHelp(String help) {
this.help = help;
}
public String getGuidCName() {
return guidCName;
}
public void setGuidCName(String guidCName) {
this.guidCName = guidCName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Vector<String> getType() {
return type;
}
public void setType(Vector<String> type) {
this.type = type;
}
public String toString() {
return name;
}
}

View File

@ -0,0 +1,97 @@
/** @file
The file is used to define Pcd Vector
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
import java.util.Vector;
public class PcdVector {
private Vector<PcdIdentification> vPcd = new Vector<PcdIdentification>();
public int findPcd(PcdIdentification sfi) {
for (int index = 0; index < vPcd.size(); index++) {
if (vPcd.elementAt(index).equals(sfi)) {
return index;
}
}
return -1;
}
public int findPcd(String name) {
for (int index = 0; index < vPcd.size(); index++) {
if (vPcd.elementAt(index).getName().equals(name)) {
return index;
}
}
return -1;
}
public PcdIdentification getPcd(int index) {
if (index > -1) {
return vPcd.elementAt(index);
} else {
return null;
}
}
public void addPcd(PcdIdentification arg0) {
vPcd.addElement(arg0);
}
public void setPcd(PcdIdentification arg0, int arg1) {
vPcd.setElementAt(arg0, arg1);
}
public void removePcd(PcdIdentification arg0) {
int index = findPcd(arg0);
if (index > -1) {
vPcd.removeElementAt(index);
}
}
public void removePcd(int index) {
if (index > -1 && index < this.size()) {
vPcd.removeElementAt(index);
}
}
public Vector<PcdIdentification> getvPcd() {
return vPcd;
}
public void setvPcd(Vector<PcdIdentification> Pcd) {
vPcd = Pcd;
}
public Vector<String> getPcdName() {
Vector<String> v = new Vector<String>();
for (int index = 0; index < this.vPcd.size(); index++) {
v.addElement(vPcd.get(index).getName());
}
return v;
}
public int size() {
return this.vPcd.size();
}
public void addAll(PcdVector v) {
if (v != null) {
for (int index = 0; index < v.size(); index++) {
vPcd.add(v.getPcd(index));
}
}
}
}