本文整理汇总了Java中com.google.common.collect.LinkedHashMultimap.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java LinkedHashMultimap.keySet方法的具体用法?Java LinkedHashMultimap.keySet怎么用?Java LinkedHashMultimap.keySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.LinkedHashMultimap
的用法示例。
在下文中一共展示了LinkedHashMultimap.keySet方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filterWavesViewBySearchCriteria
import com.google.common.collect.LinkedHashMultimap; //导入方法依赖的package包/类
protected LinkedHashMap<WaveId, WaveViewData> filterWavesViewBySearchCriteria(
Function<ReadableWaveletData, Boolean> matchesFunction,
LinkedHashMultimap<WaveId, WaveletId> currentUserWavesView) {
// Must use a map with stable ordering, since indices are meaningful.
LinkedHashMap<WaveId, WaveViewData> results = Maps.newLinkedHashMap();
// Loop over the user waves view.
for (WaveId waveId : currentUserWavesView.keySet()) {
Set<WaveletId> waveletIds = currentUserWavesView.get(waveId);
WaveViewData view = buildWaveViewData(waveId, waveletIds, matchesFunction, waveMap);
Iterable<? extends ObservableWaveletData> wavelets = view.getWavelets();
boolean hasConversation = false;
for (ObservableWaveletData waveletData : wavelets) {
if (IdUtil.isConversationalId(waveletData.getWaveletId())) {
hasConversation = true;
break;
}
}
if ((view != null) && hasConversation) {
results.put(waveId, view);
}
}
return results;
}
示例2: genCondition
import com.google.common.collect.LinkedHashMultimap; //导入方法依赖的package包/类
private StringConcatenationClient genCondition(final List<ISerializationContext> contexts, final IGrammarConstraintProvider.IConstraint constraint, final Multimap<EObject, IGrammarConstraintProvider.IConstraint> ctx2ctr) {
StringConcatenationClient _xblockexpression = null;
{
final List<ISerializationContext> sorted = IterableExtensions.<ISerializationContext>sort(contexts);
final LinkedHashMultimap<EObject, ISerializationContext> index = LinkedHashMultimap.<EObject, ISerializationContext>create();
final Consumer<ISerializationContext> _function = (ISerializationContext it) -> {
index.put(this.getContextObject(it), it);
};
sorted.forEach(_function);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
{
Set<EObject> _keySet = index.keySet();
boolean _hasElements = false;
for(final EObject obj : _keySet) {
if (!_hasElements) {
_hasElements = true;
} else {
_builder.appendImmediate("\n\t\t|| ", "");
}
StringConcatenationClient _genObjectSelector = SerializerFragment2.this.genObjectSelector(obj);
_builder.append(_genObjectSelector);
{
int _size = ctx2ctr.get(obj).size();
boolean _greaterThan = (_size > 1);
if (_greaterThan) {
StringConcatenationClient _genParameterSelector = SerializerFragment2.this.genParameterSelector(obj, index.get(obj), constraint);
_builder.append(_genParameterSelector);
}
}
}
}
}
};
_xblockexpression = _client;
}
return _xblockexpression;
}
示例3: buildModelDescription
import com.google.common.collect.LinkedHashMultimap; //导入方法依赖的package包/类
private ModelDescription buildModelDescription(final LinkedHashMultimap<String, GamlResource> resources) {
// Initializations
GAML.getExpressionFactory().resetParser();
final ModelFactory f = GAML.getModelFactory();
final String modelPath = GamlResourceServices.getModelPathOf(this);
final String projectPath = GamlResourceServices.getProjectPathOf(this);
final boolean isEdited = GamlResourceServices.isEdited(this);
final ValidationContext context = GamlResourceServices.getValidationContext(this);
// If the resources imported are null, no need to go through their
// validation
if (resources == null) {
final List<ISyntacticElement> self = Collections.singletonList(getSyntacticContents());
return f.createModelDescription(projectPath, modelPath, self, context, isEdited, null);
}
// If there are no micro-models
final Set<String> keySet = resources.keySet();
if (keySet.size() == 1 && keySet.contains(null)) {
final Iterable<ISyntacticElement> selfAndImports =
Iterables.concat(Collections.singleton(getSyntacticContents()),
Multimaps.transformValues(resources, TO_SYNTACTIC_CONTENTS).get(null));
return f.createModelDescription(projectPath, modelPath, selfAndImports, context, isEdited, null);
}
final ListMultimap<String, ISyntacticElement> models = ArrayListMultimap.create();
models.put(null, getSyntacticContents());
models.putAll(Multimaps.transformValues(resources, TO_SYNTACTIC_CONTENTS));
final List<ISyntacticElement> ownImports = models.removeAll(null);
final Map<String, ModelDescription> compiledMicroModels = new THashMap<String, ModelDescription>();
for (final String aliasName : models.keySet()) {
final ModelDescription mic = GAML.getModelFactory().createModelDescription(projectPath, modelPath,
models.get(aliasName), context, isEdited, null);
mic.setAlias(aliasName);
compiledMicroModels.put(aliasName, mic);
}
return f.createModelDescription(projectPath, modelPath, ownImports, context, isEdited, compiledMicroModels);
}
示例4: ensureWavesHaveUserDataWavelet
import com.google.common.collect.LinkedHashMultimap; //导入方法依赖的package包/类
/**
* Ensures that each wave in the current waves view has the user data wavelet by always adding
* it to the view.
*/
protected void ensureWavesHaveUserDataWavelet(
LinkedHashMultimap<WaveId, WaveletId> currentUserWavesView, ParticipantId user) {
WaveletId udw =
WaveletId.of(user.getDomain(),
IdUtil.join(IdConstants.USER_DATA_WAVELET_PREFIX, user.getAddress()));
Set<WaveId> waveIds = currentUserWavesView.keySet();
for (WaveId waveId : waveIds) {
Set<WaveletId> waveletIds = currentUserWavesView.get(waveId);
waveletIds.add(udw);
}
}
示例5: logPushResult
import com.google.common.collect.LinkedHashMultimap; //导入方法依赖的package包/类
protected void logPushResult(final LinkedHashMultimap<Feature, FeatureConfigSnapshotHolder> results) {
for (Feature f : results.keySet()) {
LOG.info("Pushed configs for feature {} {}", f, results.get(f));
}
}
示例6: generateStubFileContents
import com.google.common.collect.LinkedHashMultimap; //导入方法依赖的package包/类
public String generateStubFileContents() {
ResourceSet _resourceSet = this.grammar.eResource().getResourceSet();
String _stubPackageName = this.getStubPackageName();
String _fileHeader = this.service.naming.fileHeader();
@Extension
final JavaEMFFile file = new JavaEMFFile(_resourceSet, _stubPackageName, _fileHeader);
file.imported(IFormattableDocument.class);
final LinkedHashMultimap<EClass, EReference> type2ref = LinkedHashMultimap.<EClass, EReference>create();
this.getLocallyAssignedContainmentReferences(this.grammar, type2ref);
final LinkedHashMultimap<EClass, EReference> inheritedTypes = LinkedHashMultimap.<EClass, EReference>create();
this.getInheritedContainmentReferences(this.grammar, inheritedTypes, CollectionLiterals.<Grammar>newHashSet());
StringConcatenation _builder = new StringConcatenation();
_builder.append("class ");
String _stubSimpleName = this.getStubSimpleName();
_builder.append(_stubSimpleName);
_builder.append(" extends ");
String _imported = file.imported(this.getStubSuperClassName());
_builder.append(_imported);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("@");
String _imported_1 = file.imported(Inject.class);
_builder.append(_imported_1, "\t");
_builder.append(" extension ");
String _imported_2 = file.imported(GrammarAccessUtil.getGrammarAccessFQName(this.grammar, this.service.naming));
_builder.append(_imported_2, "\t");
_builder.newLineIfNotEmpty();
{
Set<EClass> _keySet = type2ref.keySet();
for(final EClass type : _keySet) {
_builder.newLine();
_builder.append("\t");
CharSequence _generateFormatMethod = this.generateFormatMethod(type, file, type2ref.get(type), inheritedTypes.containsKey(type));
_builder.append(_generateFormatMethod, "\t");
_builder.newLineIfNotEmpty();
}
}
_builder.append("}");
_builder.newLine();
file.setBody(_builder.toString());
return file.toString();
}
示例7: doGenerateStubFile
import com.google.common.collect.LinkedHashMultimap; //导入方法依赖的package包/类
protected void doGenerateStubFile() {
boolean _isGenerateStub = this.isGenerateStub();
boolean _not = (!_isGenerateStub);
if (_not) {
return;
}
boolean _isGenerateXtendStub = this.isGenerateXtendStub();
if (_isGenerateXtendStub) {
final XtendFileAccess xtendFile = this.fileAccessFactory.createXtendFile(this.getFormatter2Stub(this.getGrammar()));
xtendFile.setResourceSet(this.getLanguage().getResourceSet());
final LinkedHashMultimap<EClass, EReference> type2ref = LinkedHashMultimap.<EClass, EReference>create();
this.getLocallyAssignedContainmentReferences(this.getLanguage().getGrammar(), type2ref);
final LinkedHashMultimap<EClass, EReference> inheritedTypes = LinkedHashMultimap.<EClass, EReference>create();
this.getInheritedContainmentReferences(this.getLanguage().getGrammar(), inheritedTypes, CollectionLiterals.<Grammar>newHashSet());
final Set<EClass> types = type2ref.keySet();
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("class ");
String _simpleName = Formatter2Fragment2.this.getFormatter2Stub(Formatter2Fragment2.this.getGrammar()).getSimpleName();
_builder.append(_simpleName);
_builder.append(" extends ");
TypeReference _stubSuperClass = Formatter2Fragment2.this.getStubSuperClass();
_builder.append(_stubSuperClass);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("@");
_builder.append(Inject.class, "\t");
_builder.append(" extension ");
TypeReference _grammarAccess = Formatter2Fragment2.this._grammarAccessExtensions.getGrammarAccess(Formatter2Fragment2.this.getGrammar());
_builder.append(_grammarAccess, "\t");
_builder.newLineIfNotEmpty();
{
Iterable<EClass> _take = IterableExtensions.<EClass>take(types, 2);
for(final EClass type : _take) {
_builder.newLine();
_builder.append("\t");
StringConcatenationClient _generateFormatMethod = Formatter2Fragment2.this.generateFormatMethod(type, type2ref.get(type), inheritedTypes.containsKey(type));
_builder.append(_generateFormatMethod, "\t");
_builder.newLineIfNotEmpty();
}
}
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("// TODO: implement for ");
final Function1<EClass, String> _function = (EClass it) -> {
return it.getName();
};
String _join = IterableExtensions.join(IterableExtensions.<EClass, String>map(IterableExtensions.<EClass>drop(types, 2), _function), ", ");
_builder.append(_join, "\t");
_builder.newLineIfNotEmpty();
_builder.append("}");
_builder.newLine();
}
};
xtendFile.setContent(_client);
xtendFile.writeTo(this.getProjectConfig().getRuntime().getSrc());
} else {
String _name = this.getClass().getName();
String _plus = (_name + " has been configured to generate a Java stub, but that\'s not yet supported. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=481563");
Formatter2Fragment2.LOG.error(_plus);
}
}