]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java
3e6e98dac30f52d03a1cd6e3678090ba9a4c09f3
[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 vSourceFiles.addElement(sfi);
51 }
52
53 public void setSourceFiles(SourceFilesIdentification sfi, int index) {
54 vSourceFiles.setElementAt(sfi, index);
55 }
56
57 public void removeSourceFiles(SourceFilesIdentification sfi) {
58 int index = findSourceFiles(sfi);
59 if (index > -1) {
60 vSourceFiles.removeElementAt(index);
61 }
62 }
63
64 public void removeSourceFiles(int index) {
65 if (index > -1 && index < this.size()) {
66 vSourceFiles.removeElementAt(index);
67 }
68 }
69
70 public Vector<SourceFilesIdentification> getvSourceFiles() {
71 return vSourceFiles;
72 }
73
74 public void setvSourceFiles(Vector<SourceFilesIdentification> SourceFiles) {
75 vSourceFiles = SourceFiles;
76 }
77
78 public Vector<String> getSourceFilesName() {
79 Vector<String> v = new Vector<String>();
80 for (int index = 0; index < this.vSourceFiles.size(); index++) {
81 v.addElement(vSourceFiles.get(index).getFilename());
82 }
83 return v;
84 }
85
86 public int size() {
87 return this.vSourceFiles.size();
88 }
89
90 public Vector<String> toStringVector(int index) {
91 Vector<String> v = new Vector<String>();
92 v.addElement(getSourceFiles(index).getFilename());
93 return v;
94 }
95 }