本文整理汇总了Java中org.eclipse.xtext.xbase.lib.CollectionLiterals.newLinkedHashMap方法的典型用法代码示例。如果您正苦于以下问题:Java CollectionLiterals.newLinkedHashMap方法的具体用法?Java CollectionLiterals.newLinkedHashMap怎么用?Java CollectionLiterals.newLinkedHashMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.lib.CollectionLiterals
的用法示例。
在下文中一共展示了CollectionLiterals.newLinkedHashMap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGrammarConstraints
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
public Map<IGrammarConstraintProvider.IConstraint, List<ISerializationContext>> getGrammarConstraints(final Grammar grammar, final EClass clazz) {
final Map<IGrammarConstraintProvider.IConstraint, List<ISerializationContext>> result = CollectionLiterals.<IGrammarConstraintProvider.IConstraint, List<ISerializationContext>>newLinkedHashMap();
final SerializationContextMap<IGrammarConstraintProvider.IConstraint> constraints = this.gcp.getConstraints(grammar);
List<SerializationContextMap.Entry<IGrammarConstraintProvider.IConstraint>> _values = constraints.values();
for (final SerializationContextMap.Entry<IGrammarConstraintProvider.IConstraint> e : _values) {
{
final IGrammarConstraintProvider.IConstraint constraint = e.getValue();
EClass _type = constraint.getType();
boolean _tripleEquals = (_type == clazz);
if (_tripleEquals) {
List<ISerializationContext> contexts = result.get(constraint);
if ((contexts == null)) {
contexts = CollectionLiterals.<ISerializationContext>newArrayList();
result.put(constraint, contexts);
}
contexts.addAll(e.getContexts(clazz));
}
}
}
return result;
}
示例2: getSymbols
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
public List<? extends SymbolInformation> getSymbols(final XtextResource resource, final CancelIndicator cancelIndicator) {
final LinkedHashMap<EObject, SymbolInformation> symbols = CollectionLiterals.<EObject, SymbolInformation>newLinkedHashMap();
final TreeIterator<Object> contents = EcoreUtil.<Object>getAllProperContents(resource, true);
while (contents.hasNext()) {
{
this.operationCanceledManager.checkCanceled(cancelIndicator);
Object _next = contents.next();
final EObject obj = ((EObject) _next);
final SymbolInformation symbol = this.createSymbol(obj);
if ((symbol != null)) {
symbols.put(obj, symbol);
final EObject container = this.getContainer(obj);
final SymbolInformation containerSymbol = symbols.get(container);
String _name = null;
if (containerSymbol!=null) {
_name=containerSymbol.getName();
}
symbol.setContainerName(_name);
}
}
}
return IterableExtensions.<SymbolInformation>toList(symbols.values());
}
示例3: buildChildren
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
@Override
public Collection<IHierarchyNode> buildChildren(final IHierarchyNode parent, final IProgressMonitor monitor) {
boolean _mayHaveChildren = parent.mayHaveChildren();
boolean _not = (!_mayHaveChildren);
if (_not) {
return CollectionLiterals.<IHierarchyNode>emptyList();
}
final LinkedHashMap<URI, IHierarchyNode> children = CollectionLiterals.<URI, IHierarchyNode>newLinkedHashMap();
final Procedure2<IEObjectDescription, IReferenceDescription> _function = (IEObjectDescription declaration, IReferenceDescription reference) -> {
final IHierarchyNode childNode = this.createChild(children, declaration, parent);
if ((childNode != null)) {
final IHierarchyNodeReference nodeReference = this.createNodeReference(reference);
if ((nodeReference != null)) {
Collection<IHierarchyNodeReference> _references = childNode.getReferences();
_references.add(nodeReference);
}
}
};
this.findDeclarations(parent, monitor, _function);
return children.values();
}
示例4: getProperties
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
/**
* @deprecated See https://github.com/eclipse/lsp4j/issues/99
*/
@Deprecated
public Map<String, String> getProperties() {
final LinkedHashMap<String, String> properties = CollectionLiterals.<String, String>newLinkedHashMap();
Set<Map.Entry<String, Either3<String, Number, Boolean>>> _entrySet = this.entrySet();
for (final Map.Entry<String, Either3<String, Number, Boolean>> entry : _entrySet) {
{
Serializable _switchResult = null;
Either3<String, Number, Boolean> _value = entry.getValue();
final Either3<String, Number, Boolean> it = _value;
boolean _matched = false;
boolean _isFirst = it.isFirst();
if (_isFirst) {
_matched=true;
_switchResult = it.getFirst();
}
if (!_matched) {
boolean _isSecond = it.isSecond();
if (_isSecond) {
_matched=true;
_switchResult = it.getSecond();
}
}
if (!_matched) {
boolean _isThird = it.isThird();
if (_isThird) {
_matched=true;
_switchResult = it.getThird();
}
}
final Serializable value = _switchResult;
if ((value != null)) {
properties.put(entry.getKey(), value.toString());
}
}
}
return Collections.<String, String>unmodifiableMap(properties);
}
示例5: toMap
import org.eclipse.xtext.xbase.lib.CollectionLiterals; //导入方法依赖的package包/类
private static <K extends Object, V extends Object> Map<K, V> toMap(final Iterable<Pair<K, V>> items) {
LinkedHashMap<K, V> _xblockexpression = null;
{
final LinkedHashMap<K, V> result = CollectionLiterals.<K, V>newLinkedHashMap();
for (final Pair<K, V> i : items) {
result.put(i.getKey(), i.getValue());
}
_xblockexpression = result;
}
return _xblockexpression;
}