本文整理汇总了Java中com.google.common.collect.Iterators.concat方法的典型用法代码示例。如果您正苦于以下问题:Java Iterators.concat方法的具体用法?Java Iterators.concat怎么用?Java Iterators.concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.Iterators
的用法示例。
在下文中一共展示了Iterators.concat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileProperties
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public SortedSet<TaskOutputFilePropertySpec> getFileProperties() {
if (fileProperties == null) {
TaskPropertyUtils.ensurePropertiesHaveNames(filePropertiesInternal);
Iterator<TaskOutputFilePropertySpec> flattenedProperties = Iterators.concat(Iterables.transform(filePropertiesInternal, new Function<TaskPropertySpec, Iterator<? extends TaskOutputFilePropertySpec>>() {
@Override
public Iterator<? extends TaskOutputFilePropertySpec> apply(TaskPropertySpec propertySpec) {
if (propertySpec instanceof CompositeTaskOutputPropertySpec) {
return ((CompositeTaskOutputPropertySpec) propertySpec).resolveToOutputProperties();
} else {
return Iterators.singletonIterator((TaskOutputFilePropertySpec) propertySpec);
}
}
}).iterator());
fileProperties = TaskPropertyUtils.collectFileProperties("output", flattenedProperties);
}
return fileProperties;
}
示例2: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<RoutineInfo> iterator() {
return Iterators.concat(
builtInAnalyzers(),
builtInCharFilters(),
builtInTokenFilters(),
builtInTokenizers(),
customIterators()
);
}
示例3: getCompletions
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<String> getCompletions(ArgumentContext context) {
String textSoFar = context.text;
List<String> sections = COMMA_SPLITTER.splitToList(textSoFar);
String lastSection = Iterables.getLast(sections);
String prependText = String.join(",", sections.subList(0, sections.size() - 1));
Iterator<String> integer = Iterators.transform(delegate.getCompletions(context.withText(lastSection)), prependText::concat);
if (textSoFar.isEmpty() || textSoFar.endsWith(",") || textSoFar.codePoints().filter(cp -> cp == ',').count() >= (dimensions - 1)) {
return integer;
}
return Iterators.concat(integer, Iterators.transform(COMMA.iterator(), textSoFar::concat));
}
示例4: getMethods
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Nonnull
@Override
public Iterable<? extends Method> getMethods() {
return new Iterable<Method>() {
@Nonnull
@Override
public Iterator<Method> iterator() {
return Iterators.concat(getDirectMethods().iterator(), getVirtualMethods().iterator());
}
};
}
示例5: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Mapper> iterator() {
List<Mapper> extras = new ArrayList<>();
if (fieldType().isGeoHashEnabled()) {
extras.add(geoHashMapper);
}
if (fieldType().isLatLonEnabled()) {
extras.add(latMapper);
extras.add(lonMapper);
}
return Iterators.concat(super.iterator(), extras.iterator());
}
示例6: childrenIterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Tree> childrenIterator() {
return Iterators.concat(
Iterators.singletonIterator(openBracket),
content != null ? content.iterator() : new ArrayList<Tree>().iterator(),
Iterators.singletonIterator(closeBracket));
}
示例7: readdir
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public int readdir(Path path, Pointer buf, FuseFillDir filler, long offset, FuseFileInfo fi) throws IOException {
// fill in names and basic file attributes - however only the filetype is used...
// Files.walkFileTree(node, EnumSet.noneOf(FileVisitOption.class), 1, new SimpleFileVisitor<Path>() {
//
// @Override
// public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
// FileStat stat = attrUtil.basicFileAttributesToFileStat(attrs);
// if (attrs.isDirectory()) {
// stat.st_mode.set(FileStat.S_IFDIR | FileStat.ALL_READ | FileStat.S_IXUGO);
// } else {
// stat.st_mode.set(FileStat.S_IFREG | FileStat.ALL_READ);
// }
// filter.apply(buf, file.getFileName().toString(), stat, 0);
// return FileVisitResult.CONTINUE;
// }
// });
// just fill in names, getattr gets called for each entry anyway
try (DirectoryStream<Path> ds = Files.newDirectoryStream(path)) {
Iterator<Path> sameAndParent = Iterators.forArray(SAME_DIR, PARENT_DIR);
Iterator<Path> iter = Iterators.concat(sameAndParent, ds.iterator());
while (iter.hasNext()) {
String fileName = iter.next().getFileName().toString();
if (filler.apply(buf, fileName, null, 0) != 0) {
return -ErrorCodes.ENOMEM();
}
}
return 0;
} catch (DirectoryIteratorException e) {
throw new IOException(e);
}
}
示例8: childrenIterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Tree> childrenIterator() {
return Iterators.concat(
Iterators.singletonIterator(ife),
elseIf.iterator(),
Iterators.singletonIterator(elsee));
}
示例9: childrenIterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Tree> childrenIterator() {
return Iterators.concat(
Iterators.forArray(lessParentCombinator, scssParentCombinator),
compoundSelectorsCombinationList.elementsAndSeparators(Function.identity(), Function.identity()),
Iterators.forArray(scssBlockCombinator, lessExtend, lessMixinParameters, lessMixinGuard));
}
示例10: childrenIterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Tree> childrenIterator() {
return Iterators.concat(
Iterators.singletonIterator(openParenthesis),
parameters != null ? parameters.elementsAndSeparators(Function.identity(), Function.identity()) : new ArrayList<Tree>().iterator(),
Iterators.singletonIterator(closeParenthesis));
}
示例11: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public Iterator<ColumnDefinition> iterator()
{
return Iterators.concat(statics.iterator(), regulars.iterator());
}
示例12: selectOrderIterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public Iterator<ColumnDefinition> selectOrderIterator()
{
return Iterators.concat(statics.selectOrderIterator(), regulars.selectOrderIterator());
}
示例13: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<NMSFurnaceRecipe> iterator() {
return Iterators.concat(customRecipes.values().iterator(), vanillaRecipes.values().iterator());
}
示例14: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Recipe> iterator() {
return Iterators.concat(shapedRecipes.iterator(), shapelessRecipes.iterator(), dynamicRecipes.iterator());
}
示例15: nodesWithin
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Node> nodesWithin(BoundingBox bbox) {
return Iterators.concat(file1.nodesWithin(bbox), file2.nodesWithin(bbox));
}