/** * Creates a mutable {@link LinkedHashSet} instance containing the given initial elements. * * @param initial * the initial elements that the set should contain, in order. May not be <code>null</code> but may * contain <code>null</code> values. * @return a new {@link LinkedHashSet} containing those elements */ @SafeVarargs @Pure public static <T> LinkedHashSet<T> newLinkedHashSet(T... initial) { if (initial.length > 0) return Sets.newLinkedHashSet(Arrays.asList(initial)); return newLinkedHashSet(); }
private LinkedHashSet<String> containedTypes(final Path file, @Extension final TransformationContext context) { LinkedHashSet<String> _xblockexpression = null; { CharSequence _contents = context.getContents(file); final Matcher matcher = Reflections.TYPE_PATTERN.matcher(_contents); final LinkedHashSet<String> typeNames = CollectionLiterals.<String>newLinkedHashSet(); while (matcher.find()) { String _group = matcher.group(2); typeNames.add(_group); } _xblockexpression = typeNames; } return _xblockexpression; }
public Set<ISyntacticSequencerPDAProvider.ISynTransition> getAllAmbiguousTransitions() { final Set<ISyntacticSequencerPDAProvider.ISynTransition> result = CollectionLiterals.<ISyntacticSequencerPDAProvider.ISynTransition>newLinkedHashSet(); List<ISyntacticSequencerPDAProvider.ISynAbsorberState> _allPDAs = this.getAllPDAs(); for (final ISyntacticSequencerPDAProvider.ISynAbsorberState start : _allPDAs) { this.collectAllAmbiguousTransitions(start, result, CollectionLiterals.<Object>newHashSet()); } return result; }
public Set<TypeReference> getImplementedInterfaces(final TypeReference it) { Set<TypeReference> _xblockexpression = null; { final LinkedHashSet<TypeReference> seen = CollectionLiterals.<TypeReference>newLinkedHashSet(); this.collectAllSuperTypes(it, seen); final Function1<TypeReference, Boolean> _function = (TypeReference it_1) -> { Type _type = it_1.getType(); return Boolean.valueOf((_type instanceof InterfaceDeclaration)); }; _xblockexpression = IterableExtensions.<TypeReference>toSet(IterableExtensions.<TypeReference>filter(seen, _function)); } return _xblockexpression; }
public List<ProjectDescription> sortByDependencies(final Iterable<ProjectDescription> descriptions, final Procedure1<? super ProjectDescription> cyclicAcceptor) { List<ProjectDescription> _xblockexpression = null; { this.cyclicAcceptor = new IAcceptor<ProjectDescription>() { public void accept(ProjectDescription arg0) { cyclicAcceptor.apply(arg0); } }; final Function1<ProjectDescription, TopologicalSorter.Entry> _function = (ProjectDescription it) -> { return new TopologicalSorter.Entry(it); }; final Function1<TopologicalSorter.Entry, String> _function_1 = (TopologicalSorter.Entry it) -> { return it.description.getName(); }; this.name2entry = IterableExtensions.<String, TopologicalSorter.Entry>toMap(IterableExtensions.<ProjectDescription, TopologicalSorter.Entry>map(descriptions, _function), _function_1); this.result = CollectionLiterals.<ProjectDescription>newLinkedHashSet(); final Consumer<TopologicalSorter.Entry> _function_2 = (TopologicalSorter.Entry it) -> { this.visit(it); }; this.name2entry.values().forEach(_function_2); _xblockexpression = IterableExtensions.<ProjectDescription>toList(this.result); } return _xblockexpression; }
public Object evaluate(final XExpression expression, final JvmTypeReference expectedType) { final ClassLoader classLoader = this.classLoaderProvider.getClassLoader(expression); final Map<String, JvmIdentifiableElement> visibleFeatures = this.findVisibleFeatures(expression); JvmTypeReference _xifexpression = null; if ((expectedType instanceof XComputedTypeReference)) { _xifexpression = null; } else { _xifexpression = expectedType; } ClassFinder _classFinder = new ClassFinder(classLoader); LinkedHashSet<XExpression> _newLinkedHashSet = CollectionLiterals.<XExpression>newLinkedHashSet(); Context _context = new Context(_xifexpression, _classFinder, visibleFeatures, _newLinkedHashSet); final Object result = this.evaluate(expression, _context); return result; }
final LinkedHashSet<Type> types = CollectionLiterals.<Type>newLinkedHashSet(); Iterable<? extends Path> _children = this.context.getChildren(packageFolder); final Function1<Path, Boolean> _function = new Function1<Path, Boolean>() {