]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / Identifications / SourceFiles / SourceFilesVector.java
1 /** @file
2
3 The file is used to define Source Files Vector
4
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 package org.tianocore.frameworkwizard.module.Identifications.SourceFiles;
17
18 import java.util.Vector;
19
20 public class SourceFilesVector {
21 private Vector<SourceFilesIdentification> vSourceFiles = new Vector<SourceFilesIdentification>();
22
23 public int findSourceFiles(SourceFilesIdentification sfi) {
24 for (int index = 0; index < vSourceFiles.size(); index++) {
25 if (vSourceFiles.elementAt(index).equals(sfi)) {
26 return index;
27 }
28 }
29 return -1;
30 }
31
32 public int findSourceFiles(String name) {
33 for (int index = 0; index < vSourceFiles.size(); index++) {
34 if (vSourceFiles.elementAt(index).getFilename().equals(name)) {
35 return index;
36 }
37 }
38 return -1;
39 }
40
41 public SourceFilesIdentification getSourceFiles(int index) {
42 if (index > -1) {
43 return vSourceFiles.elementAt(index);
44 } else {
45 return null;
46 }
47 }
48
49 public void addSourceFiles(SourceFilesIdentification sfi) {
50 if (findSourceFiles(sfi) == -1) {
51 vSourceFiles.addElement(sfi);
52 }
53 }
54
55 public void setSourceFiles(SourceFilesIdentification sfi, int index) {
56 vSourceFiles.setElementAt(sfi, index);
57 }
58
59 public void removeSourceFiles(SourceFilesIdentification sfi) {
60 int index = findSourceFiles(sfi);
61 if (index > -1) {
62 vSourceFiles.removeElementAt(index);
63 }
64 }
65
66 public void removeSourceFiles(int index) {
67 if (index > -1 && index < this.size()) {
68 vSourceFiles.removeElementAt(index);
69 }
70 }
71
72 public Vector<SourceFilesIdentification> getvSourceFiles() {
73 return vSourceFiles;
74 }
75
76 public void setvSourceFiles(Vector<SourceFilesIdentification> SourceFiles) {
77 vSourceFiles = SourceFiles;
78 }
79
80 public Vector<String> getSourceFilesName() {
81 Vector<String> v = new Vector<String>();
82 for (int index = 0; index < this.vSourceFiles.size(); index++) {
83 v.addElement(vSourceFiles.get(index).getFilename());
84 }
85 return v;
86 }
87
88 public int size() {
89 return this.vSourceFiles.size();
90 }
91
92 public Vector<String> toStringVector(int index) {
93 Vector<String> v = new Vector<String>();
94 v.addElement(getSourceFiles(index).getFilename());
95 v.addElement(getSourceFiles(index).getTagName());
96 v.addElement(getSourceFiles(index).getToolCode());
97 v.addElement(getSourceFiles(index).getToolChainFamily());
98 return v;
99 }
100 }