當前位置: 首頁>>代碼示例>>Java>>正文


Java LinkedHashMultimap.keySet方法代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:incubator-wave,代碼行數:25,代碼來源:AbstractSearchProviderImpl.java

示例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;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:40,代碼來源:SerializerFragment2.java

示例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);
	}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:37,代碼來源:GamlResource.java

示例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);
  }
}
 
開發者ID:apache,項目名稱:incubator-wave,代碼行數:16,代碼來源:AbstractSearchProviderImpl.java

示例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));
    }
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:6,代碼來源:ConfigPushingRunnable.java

示例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();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:46,代碼來源:FormatterStubGenerator.java

示例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);
  }
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:68,代碼來源:Formatter2Fragment2.java


注:本文中的com.google.common.collect.LinkedHashMultimap.keySet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。