]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Database.java
Fixed EDKT102;
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / Database.java
1 /** @file
2 Database class.
3
4 Database represents an exceplicity name list of database file.
5
6 Copyright (c) 2006, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16 package org.tianocore.framework.tasks;
17
18 import java.io.File;
19 import java.util.ArrayList;
20 import java.util.List;
21 import java.util.StringTokenizer;
22
23 /**
24 Database
25
26 Database represents an exceplicity name list of database file.
27
28 **/
29 public class Database implements NestElement{
30 ///
31 /// name of database file
32 ///
33 private String name = "";
34 ///
35 /// name of file including database files
36 ///
37 private File file;
38 ///
39 /// the database file name list
40 ///
41 private List<String> nameList = new ArrayList<String>();
42
43 /**
44 getName
45
46 This function is to get class member "name".
47
48 @return class member "name".
49 **/
50 public String getName() {
51 return this.name;
52 }
53 /**
54 setName
55
56 This function is to set class member "name".
57
58 @param name : name of database file.
59 **/
60 public void setName(String name) {
61 this.name = " -db " + name;
62 }
63
64 /**
65 toString
66
67 This function is to call getName() function.
68 @return class member "name".
69 **/
70 public String toString() {
71 return getName();
72 }
73
74 /**
75 getFile
76
77 This function is to get file which include the database file list.
78
79 @return class member "file"
80
81 **/
82 public File getFile() {
83 return this.file;
84 }
85 /**
86 setFile
87
88 This function is to set class member "file".
89
90 @param file The file which include the database file list.
91 **/
92 public void setFile(File file) {
93 this.file = file;
94 }
95
96
97 public void setList(String fileNameList) {
98 if (fileNameList != null && fileNameList.length() > 0) {
99 StringTokenizer tokens = new StringTokenizer(fileNameList, " \t,;", false);
100 while (tokens.hasMoreTokens()) {
101 String fileName = tokens.nextToken().trim();
102 if (fileName.length() > 0) {
103 this.nameList.add(fileName);
104 }
105 }
106 }
107 }
108
109 public List<String> getList() {
110 return nameList;
111 }
112 }