本文整理汇总了Java中com.google.common.collect.Iterables.all方法的典型用法代码示例。如果您正苦于以下问题:Java Iterables.all方法的具体用法?Java Iterables.all怎么用?Java Iterables.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.Iterables
的用法示例。
在下文中一共展示了Iterables.all方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enclosedBy
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public Ordering<Element> enclosedBy(Element element) {
if (element instanceof ElementImpl &&
Iterables.all(element.getEnclosedElements(), Predicates.instanceOf(ElementImpl.class))) {
ElementImpl implementation = (ElementImpl) element;
if (implementation._binding instanceof SourceTypeBinding) {
SourceTypeBinding sourceBinding = (SourceTypeBinding) implementation._binding;
return Ordering.natural().onResultOf(
Functions.compose(bindingsToSourceOrder(sourceBinding), this));
}
}
return DEFAULT_PROVIDER.enclosedBy(element);
}
示例2: waitForCachedMaterialization
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
public void waitForCachedMaterialization(final AccelerationId id) throws Exception {
for (int i = 0; i < 60; i++) {
Thread.sleep(500);
final List<Materialization> materializations = getMaterializations(id);
final boolean allDone = Iterables.all(materializations, new Predicate<Materialization>() {
@Override
public boolean apply(@Nullable final Materialization input) {
return getAccelerationService().isMaterializationCached(input.getId());
}
});
if (allDone) {
return ;
}
}
Assert.fail("Timed out waiting for cached materializations");
}
示例3: withProperty
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
public <V> IExtendedBlockState withProperty(IUnlistedProperty<V> property, V value)
{
if(!this.unlistedProperties.containsKey(property))
{
throw new IllegalArgumentException("Cannot set unlisted property " + property + " as it does not exist in " + getBlock().getBlockState());
}
if(!property.isValid(value))
{
throw new IllegalArgumentException("Cannot set unlisted property " + property + " to " + value + " on block " + Block.REGISTRY.getNameForObject(getBlock()) + ", it is not an allowed value");
}
Map<IUnlistedProperty<?>, Optional<?>> newMap = new HashMap<IUnlistedProperty<?>, Optional<?>>(unlistedProperties);
newMap.put(property, Optional.fromNullable(value));
if(Iterables.all(newMap.values(), Predicates.<Optional<?>>equalTo(Optional.absent())))
{ // no dynamic properties, lookup normal state
return (IExtendedBlockState) normalMap.get(getProperties());
}
return new ExtendedStateImplementation(getBlock(), getProperties(), ImmutableMap.copyOf(newMap), propertyValueTable).setMap(this.normalMap);
}
示例4: allTypesKnown
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
private static boolean allTypesKnown(List<? extends DataType> keyTypes) {
return Iterables.all(keyTypes, new Predicate<DataType>() {
@Override
public boolean apply(@Nullable DataType input) {
return input != null && !input.equals(DataTypes.UNDEFINED);
}
});
}
示例5: isRejected
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean isRejected(final IFolder folder) {
return Iterables.all(contributions, c -> c.isRejected(folder));
}
示例6: validText
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean validText(ArgumentContext context) {
return Iterables.all(COMMA_SPLITTER.limit(dimensions).split(context.text), number -> delegate.validText(context.withText(number)));
}
示例7: isEmpty
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean isEmpty() {
return Iterables.all(subsets, Collection::isEmpty);
}
示例8: readyToStart
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
/**
* Determines whether or not the current match is ready to begin.
*
* @return Whether or not the current match is ready to begin.
*/
public boolean readyToStart() {
return isReady(match.getDefaultParty()) &&
Iterables.all(teamManager.getMappedTeams(),
ReadyManager.this::isReady);
}
示例9: validStreamers
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
private static boolean validStreamers(Streamer<?>[] streamers) {
if (streamers == null || streamers.length == 0) {
return true;
}
return !Iterables.all(FluentIterable.of(streamers), Predicates.isNull());
}