本文整理匯總了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));
}