本文整理汇总了Java中com.google.common.collect.ImmutableSetMultimap.copyOf方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableSetMultimap.copyOf方法的具体用法?Java ImmutableSetMultimap.copyOf怎么用?Java ImmutableSetMultimap.copyOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.ImmutableSetMultimap
的用法示例。
在下文中一共展示了ImmutableSetMultimap.copyOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EventArgScoringAlignment
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
private EventArgScoringAlignment(final Symbol docID,
final ArgumentOutput argumentOutput,
final AnswerKey answerKey,
final Iterable<EquivClassType> truePositiveECs,
final Iterable<EquivClassType> falsePositiveECs,
final Iterable<EquivClassType> falseNegativeECs,
final Iterable<EquivClassType> unassessed,
final Multimap<EquivClassType, AssessedResponse> ecsToAnswerKey,
final Multimap<EquivClassType, Response> ecsToSystem) {
this.docID = checkNotNull(docID);
this.argumentOutput = checkNotNull(argumentOutput);
this.answerKey = checkNotNull(answerKey);
this.truePositiveECs = ImmutableSet.copyOf(truePositiveECs);
this.falsePositiveECs = ImmutableSet.copyOf(falsePositiveECs);
this.falseNegativeECs = ImmutableSet.copyOf(falseNegativeECs);
this.unassessed = ImmutableSet.copyOf(unassessed);
this.ecsToAnswerKey = ImmutableSetMultimap.copyOf(ecsToAnswerKey);
this.ecsToSystem = ImmutableSetMultimap.copyOf(ecsToSystem);
}
示例2: IvyDependencyMetadata
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
public IvyDependencyMetadata(ModuleVersionSelector requested, String dynamicConstraintVersion, boolean force, boolean changing, boolean transitive, Multimap<String, String> confMappings, List<Artifact> artifacts, List<Exclude> excludes) {
super(requested, artifacts);
this.dynamicConstraintVersion = dynamicConstraintVersion;
this.force = force;
this.changing = changing;
this.transitive = transitive;
this.confs = ImmutableSetMultimap.copyOf(confMappings);
this.excludes = ImmutableList.copyOf(excludes);
}
示例3: unforceChunk
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
/**
* Unforce the supplied chunk, allowing it to be unloaded and stop ticking.
*
* @param ticket The ticket holding the chunk
* @param chunk The chunk to unforce
*/
public static void unforceChunk(Ticket ticket, ChunkPos chunk)
{
if (ticket == null || chunk == null)
{
return;
}
ticket.requestedChunks.remove(chunk);
MinecraftForge.EVENT_BUS.post(new UnforceChunkEvent(ticket, chunk));
LinkedHashMultimap<ChunkPos, Ticket> copy = LinkedHashMultimap.create(forcedChunks.get(ticket.world));
copy.remove(chunk, ticket);
ImmutableSetMultimap<ChunkPos, Ticket> newMap = ImmutableSetMultimap.copyOf(copy);
forcedChunks.put(ticket.world,newMap);
}
示例4: unforceChunk
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
/**
* Unforce the supplied chunk, allowing it to be unloaded and stop ticking.
*
* @param ticket The ticket holding the chunk
* @param chunk The chunk to unforce
*/
public static void unforceChunk(Ticket ticket, ChunkCoordIntPair chunk)
{
if (ticket == null || chunk == null)
{
return;
}
ticket.requestedChunks.remove(chunk);
MinecraftForge.EVENT_BUS.post(new UnforceChunkEvent(ticket, chunk));
LinkedHashMultimap<ChunkCoordIntPair, Ticket> copy = LinkedHashMultimap.create(forcedChunks.get(ticket.world));
copy.remove(chunk, ticket);
ImmutableSetMultimap<ChunkCoordIntPair, Ticket> newMap = ImmutableSetMultimap.copyOf(copy);
forcedChunks.put(ticket.world,newMap);
}
示例5: makeImmutable
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
@Nonnull
@Override
public ImmutableContextSet makeImmutable() {
// if the map is empty, don't create a new instance
if (this.map.isEmpty()) {
return ImmutableContextSet.empty();
}
return new ImmutableContextSet(ImmutableSetMultimap.copyOf(this.map));
}
示例6: supply
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
@Override
protected ImmutableSetMultimap<ImmutableContextSet, Node> supply() {
PermissionHolder.this.nodesLock.lock();
try {
return ImmutableSetMultimap.copyOf(PermissionHolder.this.nodes);
} finally {
PermissionHolder.this.nodesLock.unlock();
}
}
示例7: getStandardPendingDeposits
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
private ImmutableSetMultimap<String, PendingDeposit> getStandardPendingDeposits() {
if (directory.isPresent()) {
throw new BadRequestException("Directory parameter not allowed in standard operation");
}
if (!modeStrings.isEmpty()) {
throw new BadRequestException("Mode parameter not allowed in standard operation");
}
if (!tlds.isEmpty()) {
throw new BadRequestException("Tld parameter not allowed in standard operation");
}
if (!watermarks.isEmpty()) {
throw new BadRequestException("Watermark parameter not allowed in standard operation");
}
if (revision.isPresent()) {
throw new BadRequestException("Revision parameter not allowed in standard operation");
}
return ImmutableSetMultimap.copyOf(
Multimaps.filterValues(
pendingDepositChecker.getTldsAndWatermarksPendingDepositForRdeAndBrda(),
pending -> {
if (clock.nowUtc().isBefore(pending.watermark().plus(transactionCooldown))) {
logger.infofmt("Ignoring within %s cooldown: %s", transactionCooldown, pending);
return false;
} else {
return true;
}
}));
}
示例8: CombinedMultimapMockBean
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
/**
* Restricted constructor.
* @param builder the builder to copy from, not null
*/
protected CombinedMultimapMockBean(CombinedMultimapMockBean.Builder builder) {
JodaBeanUtils.notNull(builder._setMultimap, "setMultimap");
JodaBeanUtils.notNull(builder._listMultimap, "listMultimap");
JodaBeanUtils.notNull(builder._noTypeMultimap, "noTypeMultimap");
this._setMultimap = ImmutableSetMultimap.copyOf(builder._setMultimap);
this._listMultimap = ImmutableListMultimap.copyOf(builder._listMultimap);
this._noTypeMultimap = ImmutableMultimap.copyOf(builder._noTypeMultimap);
}
示例9: retrieveAllHUIdsIndexedByPickingSlotId
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
@Override
public SetMultimap<Integer, Integer> retrieveAllHUIdsIndexedByPickingSlotId(final Collection<? extends de.metas.picking.model.I_M_PickingSlot> pickingSlots)
{
if (pickingSlots.isEmpty())
{
return ImmutableSetMultimap.of();
}
final Set<Integer> pickingSlotIds = pickingSlots.stream().map(pickingSlot -> pickingSlot.getM_PickingSlot_ID()).collect(ImmutableSet.toImmutableSet());
final LinkedHashMultimap<Integer, Integer> pickingSlotId2huIds = LinkedHashMultimap.create();
// Retrieve current picking slot HUs
pickingSlots.stream()
.map(pickingSlot -> InterfaceWrapperHelper.create(pickingSlot, I_M_PickingSlot.class))
.filter(pickingSlot -> pickingSlot.getM_HU_ID() > 0)
.forEach(pickingSlot -> pickingSlotId2huIds.put(pickingSlot.getM_PickingSlot_ID(), pickingSlot.getM_HU_ID()));
// Retrieve the HUs from picking slot queue.
Services.get(IQueryBL.class)
.createQueryBuilder(I_M_PickingSlot_HU.class)
.addOnlyActiveRecordsFilter()
.addInArrayFilter(I_M_PickingSlot_HU.COLUMN_M_PickingSlot_ID, pickingSlotIds)
.create()
.stream(I_M_PickingSlot_HU.class)
.forEach(pickingSlotHU -> pickingSlotId2huIds.put(pickingSlotHU.getM_PickingSlot_ID(), pickingSlotHU.getM_HU_ID()));
return ImmutableSetMultimap.copyOf(pickingSlotId2huIds);
}
示例10: setDynamismLevels
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
/**
* Sets the dynamism levels.
* @param levels At least one level must be given. The default level is
* <code>.5</code>.
* @return This, as per the builder pattern.
*/
public Builder setDynamismLevels(Iterable<Double> levels) {
checkArgument(Iterables.size(levels) > 0);
final RangeSet<Double> rangeSet = TreeRangeSet.create();
final Set<Range<Double>> dynamismLevelsB = new LinkedHashSet<>();
final RangeMap<Double, Double> map = TreeRangeMap.create();
for (final Double d : levels) {
checkArgument(d >= 0d && d <= 1d);
final Range<Double> newRange = createDynRange(d);
checkArgument(
rangeSet.subRangeSet(newRange).isEmpty(),
"Can not add dynamism level %s, it is too close to another level.",
d);
rangeSet.add(newRange);
dynamismLevelsB.add(newRange);
map.put(newRange, d);
}
final SetMultimap<TimeSeriesType, Range<Double>> timeSeriesTypes =
LinkedHashMultimap
.<TimeSeriesType, Range<Double>>create();
for (final Range<Double> r : dynamismLevelsB) {
checkArgument(DYNAMISM_MAP.get(r.lowerEndpoint()) != null);
checkArgument(DYNAMISM_MAP.get(r.lowerEndpoint()) == DYNAMISM_MAP.get(r
.upperEndpoint()));
timeSeriesTypes.put(DYNAMISM_MAP.get(r.lowerEndpoint()), r);
}
dynamismLevels = ImmutableSetMultimap.copyOf(timeSeriesTypes);
dynamismRangeMap = ImmutableRangeMap.copyOf(map);
return this;
}
示例11: create
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
static AllExternalIds create(Multimap<Account.Id, ExternalId> byAccount) {
ImmutableSetMultimap<String, ExternalId> byEmail =
byAccount
.values()
.stream()
.filter(e -> !Strings.isNullOrEmpty(e.email()))
.collect(toImmutableSetMultimap(ExternalId::email, e -> e));
return new AutoValue_ExternalIdCacheImpl_AllExternalIds(
ImmutableSetMultimap.copyOf(byAccount), byEmail);
}
示例12: EquivalenceBasedProvenancedAlignment
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
private EquivalenceBasedProvenancedAlignment(
final Multimap<? extends EqClassT, ? extends LeftT> leftEquivalenceClassesToProvenances,
final Multimap<? extends EqClassT, ? extends RightT> rightEquivalenceClassesToProvenances) {
this.leftEquivalenceClassesToProvenances = ImmutableSetMultimap
.copyOf(leftEquivalenceClassesToProvenances);
this.rightEquivalenceClassesToProvenances = ImmutableSetMultimap.copyOf(
rightEquivalenceClassesToProvenances);
}
示例13: MultimapAlignment
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
private MultimapAlignment(final Iterable<? extends LeftT> leftItems,
final Iterable<? extends RightT> rightItems,
final Multimap<? extends LeftT, ? extends RightT> leftToRight,
final Multimap<? extends RightT, ? extends LeftT> rightToLeft) {
this.leftItems = ImmutableSet.copyOf(leftItems);
this.rightItems = ImmutableSet.copyOf(rightItems);
this.leftToRight = ImmutableSetMultimap.copyOf(leftToRight);
this.rightToLeft = ImmutableSetMultimap.copyOf(rightToLeft);
checkArgument(this.leftItems.containsAll(leftToRight.keySet()));
checkArgument(this.rightItems.containsAll(rightToLeft.keySet()));
}
示例14: insert
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
@Override
public JmhSetMultimap insert(JmhValue key, JmhValue value) {
final SetMultimap<JmhValue, JmhValue> tmpContent = HashMultimap.create(content);
tmpContent.put(key, value);
final ImmutableSetMultimap<JmhValue, JmhValue> newContent = ImmutableSetMultimap
.copyOf(tmpContent);
return new ImmutableGuavaSetMultimap(newContent);
// final ImmutableSetMultimap<JmhValue, JmhValue> newContent =
// ImmutableSetMultimap.<JmhValue, JmhValue>builder().putAll(content).put(key, value).build();
//
// return new ImmutableGuavaSetMultimap(newContent);
}
示例15: remove
import com.google.common.collect.ImmutableSetMultimap; //导入方法依赖的package包/类
@Override
public JmhSetMultimap remove(JmhValue key, JmhValue value) {
final SetMultimap<JmhValue, JmhValue> tmpContent = HashMultimap.create(content);
tmpContent.remove(key, value);
final ImmutableSetMultimap<JmhValue, JmhValue> newContent = ImmutableSetMultimap
.copyOf(tmpContent);
return new ImmutableGuavaSetMultimap(newContent);
}