From 985384609e468bb6d6b9c2507f6009b3fb6bc044 Mon Sep 17 00:00:00 2001 From: hche10x Date: Fri, 14 Jul 2006 05:45:53 +0000 Subject: [PATCH] 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 --- .../PcdCoded/PcdIdentification.java | 74 ++++++++++++++ .../Identifications/PcdCoded/PcdVector.java | 97 +++++++++++++++++++ 2 files changed, 171 insertions(+) create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java new file mode 100644 index 0000000000..85a770662a --- /dev/null +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java @@ -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 type = null; + + public PcdIdentification(String arg0, String arg1, String arg2, Vector 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 getType() { + return type; + } + + public void setType(Vector type) { + this.type = type; + } + + public String toString() { + return name; + } +} diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java new file mode 100644 index 0000000000..5834744bdc --- /dev/null +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java @@ -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 vPcd = new Vector(); + + 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 getvPcd() { + return vPcd; + } + + public void setvPcd(Vector Pcd) { + vPcd = Pcd; + } + + public Vector getPcdName() { + Vector v = new Vector(); + 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)); + } + } + } +} -- 2.39.2