当前位置: 首页>>代码示例>>Java>>正文


Java Iterables.any方法代码示例

本文整理汇总了Java中com.google.common.collect.Iterables.any方法的典型用法代码示例。如果您正苦于以下问题:Java Iterables.any方法的具体用法?Java Iterables.any怎么用?Java Iterables.any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.Iterables的用法示例。


在下文中一共展示了Iterables.any方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeViewPropertyDslMethods

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
private void writeViewPropertyDslMethods(ClassVisitor visitor, Type generatedType, Collection<ModelProperty<?>> viewProperties, Class<?> viewClass) {
    boolean writable = Iterables.any(viewProperties, new Predicate<ModelProperty<?>>() {
        @Override
        public boolean apply(ModelProperty<?> viewProperty) {
            return viewProperty.isWritable();
        }
    });
    // TODO:LPTR Instead of the first view property, we should figure out these parameters from the actual property
    ModelProperty<?> firstProperty = viewProperties.iterator().next();

    writeConfigureMethod(visitor, generatedType, firstProperty, writable);
    writeSetMethod(visitor, generatedType, firstProperty);
    writeTypeConvertingSetter(visitor, generatedType, viewClass, firstProperty);

    // TODO - this should be applied to all methods, including delegating methods
    writeReadOnlySetter(visitor, viewClass, writable, firstProperty);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:ManagedProxyClassGenerator.java

示例2: isLayoutFile

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean isLayoutFile(@Nullable final FileObject fo) {
    if (fo == null || !"xml".equals(fo.getExt())) {
        return false;
    }
    Project p = FileOwnerQuery.getOwner(fo);
    if (p.getLookup().lookup(GradleAndroidClassPathProvider.class) == null) {
        return false;
    }
    return Iterables.any(
            Arrays.asList(ProjectUtils.getSources(p).getSourceGroups(AndroidConstants.SOURCES_TYPE_ANDROID_RES)),
            new Predicate<SourceGroup>() {
        @Override
        public boolean apply(SourceGroup t) {
            FileObject folder = fo.getParent();
            if (folder == null) {
                return false;
            }
            return FileUtil.isParentOf(t.getRootFolder(), fo)
                    && "xml".equals(fo.getExt())
                    && ("layout".equals(folder.getNameExt()) || folder.getNameExt().startsWith("layout-"));
        }
    });
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:25,代码来源:AndroidFileTypesImpl.java

示例3: of

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
public static DependentComponentsRenderableDependency of(ComponentSpec componentSpec, ComponentSpecInternal internalProtocol, LinkedHashSet<DependentComponentsRenderableDependency> children) {
    ComponentSpecIdentifier id = internalProtocol.getIdentifier();
    String name = DependentComponentsUtils.getBuildScopedTerseName(id);
    String description = componentSpec.getDisplayName();
    boolean buildable = true;
    if (componentSpec instanceof VariantComponentSpec) {
        // Consider variant aware components with no buildable binaries as non-buildables
        VariantComponentSpec variantComponentSpec = (VariantComponentSpec) componentSpec;
        buildable = Iterables.any(variantComponentSpec.getBinaries().values(), new Predicate<BinarySpec>() {
            @Override
            public boolean apply(BinarySpec binarySpec) {
                return binarySpec.isBuildable();
            }
        });
    }
    boolean testSuite = false;
    return new DependentComponentsRenderableDependency(id, name, description, buildable, testSuite, children);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:DependentComponentsRenderableDependency.java

示例4: isDirectPolyfill

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
/**
 * Returns true if the given container type is a polyfill of the bottom type.
 * <p>
 * Note: we compare via FQN here, since the bottom type may not stem from the index but from the type model
 * derived from the AST. In that case, the type instance, although similar, differs from the type instance
 * from the index.
 */
private boolean isDirectPolyfill(ContainerType<?> containerType) {
	if (!containerType.isStaticPolyfill() || !(bottomType instanceof TClassifier)) {
		return false;
	}
	QualifiedName qn = N4TSQualifiedNameProvider.getStaticPolyfillFQN((TClassifier) bottomType,
			qualifiedNameProvider);
	if (containerType instanceof TClass) { // short cut
		return qn.equals(qualifiedNameProvider.getFullyQualifiedName(containerType));
	}
	if (containerType instanceof TN4Classifier) {
		return Iterables.any(((TN4Classifier) containerType).getSuperClassifierRefs(),
				ref -> qn.equals(qualifiedNameProvider.getFullyQualifiedName(ref.getDeclaredType())));

	}
	return false;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:24,代码来源:ContainerTypesHelper.java

示例5: hasLiveData

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
public boolean hasLiveData(int nowInSec)
{
    if (primaryKeyLivenessInfo().isLive(nowInSec))
        return true;

    return Iterables.any(cells(), cell -> cell.isLive(nowInSec));
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:8,代码来源:AbstractRow.java

示例6: supportsJmx

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
public boolean supportsJmx() {
    boolean pre062 = Iterables.any(getAgentConfConventionValue(), new Predicate<File>() {
        @Override
        public boolean apply(File file) {
            return V_0_6_2_0.compareTo(extractVersion(file.getName())) > 0;
        }
    });
    return !pre062;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:JacocoAgentJar.java

示例7: hasOutput

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean hasOutput(long id, final TestOutputEvent.Destination destination) {
    return Iterables.any(
            classOutputProviders.get(id),
            new Predicate<DelegateProvider>() {
                public boolean apply(DelegateProvider delegateProvider) {
                    return delegateProvider.provider.hasOutput(delegateProvider.id, destination);
                }
            });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:AggregateTestResultsProvider.java

示例8: containsLibraryWithSameName

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
private static boolean containsLibraryWithSameName(Set<ProjectLibrary> libraries, final String name) {
    return Iterables.any(libraries, new Predicate<ProjectLibrary>() {
        @Override
        public boolean apply(ProjectLibrary library) {
            return Objects.equal(library.getName(), name);
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:IdeaScalaConfigurer.java

示例9: pathMatches

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean pathMatches(final Path path) {
    return Iterables.any(basePaths, basePath -> {
        if (basePath == null) {
            return false;
        }

        Path normalizedPath = path.normalize();
        normalizedPath = basePath.getParent().resolve(normalizedPath);

        return basePath.equals(normalizedPath);
    });
}
 
开发者ID:DevOpsStudio,项目名称:Re-Collector,代码行数:14,代码来源:ExactFileStrategy.java

示例10: pathMatches

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean pathMatches(final Path path) {
    return Iterables.any(basePaths, basePath -> {
        if (basePath == null) {
            return false;
        }

        Path normalizedPath = path.normalize();
        normalizedPath = basePath.getParent().resolve(normalizedPath);
        // only allow files in the same directory
        if (!basePath.getParent().equals(normalizedPath.getParent())) {
            return false;
        }
        final String filename = normalizedPath.getFileName().toString();
        final String baseFilename = basePath.getFileName().toString();

        // same files are a match
        if (filename.equals(baseFilename)) {
            return true;
        }

        // do the files have a common beginning? if not, they aren't related.
        if (!filename.startsWith(baseFilename)) {
            return false;
        }

        // check for number suffix
        final String onlySuffix = filename.substring(baseFilename.length());
        return onlySuffix.matches("^\\.\\d+$");
    });
}
 
开发者ID:DevOpsStudio,项目名称:Re-Collector,代码行数:32,代码来源:NumberSuffixStrategy.java

示例11: tableHasUnsupportedColumns

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
/**
 * Indicates if the table has a column with a column type which we can't
 * output to a spreadsheet.
 *
 * @param table The table metadata.
 * @return
 */
boolean tableHasUnsupportedColumns(Table table) {
  return Iterables.any(table.columns(), new Predicate<Column>() {
    @Override
    public boolean apply(Column column) {
      return !supportedDataTypes.contains(column.getType());
    }
  });
}
 
开发者ID:alfasoftware,项目名称:morf,代码行数:16,代码来源:TableOutputter.java

示例12: hasInteractiveModules

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
public boolean hasInteractiveModules() {
    return Iterables.any(items, new Predicate<ItemController>() {
        @Override
        public boolean apply(ItemController item) {
            return item.hasInteractiveModules();
        }
    });
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:PageController.java

示例13: transform

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass)
{
    if (basicClass == null) return null;

    ClassNode classNode = new ClassNode();
    new ClassReader(basicClass).accept(classNode, 0);

    boolean isSubscriber = false;

    for (MethodNode methodNode : classNode.methods)
    {
        List<AnnotationNode> anns = methodNode.visibleAnnotations;

        if (anns != null && Iterables.any(anns, SubscribeEventPredicate.INSTANCE))
        {
            if (Modifier.isPrivate(methodNode.access))
            {
                String msg = "Cannot apply @SubscribeEvent to private method %s/%s%s";
                throw new RuntimeException(String.format(msg, classNode.name, methodNode.name, methodNode.desc));
            }

            methodNode.access = toPublic(methodNode.access);
            isSubscriber = true;
        }
    }

    if (isSubscriber)
    {
        classNode.access = toPublic(classNode.access);

        ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
        classNode.accept(writer);
        return writer.toByteArray();
    }

    return basicClass;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:39,代码来源:EventSubscriberTransformer.java

示例14: hasAnyNaN

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
boolean hasAnyNaN() {
  return Iterables.any(values, Predicates.equalTo(NaN));
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:4,代码来源:StatsTesting.java

示例15: hasAnyNegativeInfinity

import com.google.common.collect.Iterables; //导入方法依赖的package包/类
boolean hasAnyNegativeInfinity() {
  return Iterables.any(values, Predicates.equalTo(NEGATIVE_INFINITY));
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:4,代码来源:StatsTesting.java


注:本文中的com.google.common.collect.Iterables.any方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。