本文整理汇总了Java中org.galagosearch.tupleflow.Parameters.Value类的典型用法代码示例。如果您正苦于以下问题:Java Value类的具体用法?Java Value怎么用?Java Value使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Value类属于org.galagosearch.tupleflow.Parameters包,在下文中一共展示了Value类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.galagosearch.tupleflow.Parameters.Value; //导入依赖的package包/类
public void run() throws IOException {
if (parameters.getXML().containsKey("directory")) {
List<Value> directories = parameters.getXML().list("directory");
for (Value directory : directories) {
File directoryFile = new File(directory.toString());
processDirectory(directoryFile);
}
} else if (parameters.getXML().containsKey("filename")) {
List<Value> files = parameters.getXML().list("filename");
for (Value file : files) {
processFile(file.toString());
}
}
processor.close();
}
示例2: run
import org.galagosearch.tupleflow.Parameters.Value; //导入依赖的package包/类
public void run() throws IOException {
if (parameters.getXML().containsKey("directory")) {
List<Value> directories = parameters.getXML().list("directory");
for (Value directory : directories) {
File directoryFile = new File(directory.toString());
processDirectory(directoryFile);
}
} else if (parameters.getXML().containsKey("filename")) {
List<Value> files = parameters.getXML().list("filename");
for (Value file : files) {
String filename = file.toString();
processor.process(new FileName(filename));
}
}
processor.close();
}
示例3: FieldConflater
import org.galagosearch.tupleflow.Parameters.Value; //导入依赖的package包/类
public FieldConflater(TupleFlowParameters parameters) {
List<Value> values = parameters.getXML().list("field");
for (Value field : values) {
List<String> sources = field.stringList("source");
String destination = field.get("destination");
for (String s : sources) {
conflations.put(s, destination);
}
}
}
示例4: verify
import org.galagosearch.tupleflow.Parameters.Value; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
if (!(parameters.getXML().containsKey("directory") || parameters.getXML().containsKey("filename"))) {
handler.addError("FileSource requires either at least one directory or filename parameter.");
return;
}
if (parameters.getXML().containsKey("directory")) {
List<Value> directories = parameters.getXML().list("directory");
for (Value directory : directories) {
File directoryFile = new File(directory.toString());
if (directoryFile.exists() == false) {
handler.addError("Directory " + directoryFile.toString() + " doesn't exist.");
} else if (directoryFile.isDirectory() == false) {
handler.addError(directoryFile.toString() + " exists, but it isn't a directory.");
}
}
} else if (parameters.getXML().containsKey("filename")) {
List<Value> files = parameters.getXML().list("filename");
for (Value file : files) {
File f = new File(file.toString());
if (f.exists() == false) {
handler.addError("File " + file.toString() + " doesn't exist.");
} else if (f.isFile() == false) {
handler.addError(file.toString() + " exists, but isn't a file.");
}
}
}
}