private ArrayList<JavaSegment> sortMethodsAndSections (ArrayList<JavaMethod> methods, ArrayList<JniSection> sections) { ArrayList<JavaSegment> segments = new ArrayList<JavaSegment>(); segments.addAll(methods); segments.addAll(sections); Collections.sort(segments, new Comparator<JavaSegment>() { @Override public int compare (JavaSegment o1, JavaSegment o2) { return o1.getStartIndex() - o2.getStartIndex(); } }); return segments; }
/** * Add these Collections to the list of collections in this composite * * @param comps Collections to be appended to the composite */ public void addComposited(Collection[] comps) { ArrayList list = new ArrayList(Arrays.asList(this.all)); list.addAll(Arrays.asList(comps)); all = (Collection[]) list.toArray(new Collection[list.size()]); }
process(files, outputRoot, outputRoot, dirToEntries, 0); ArrayList<Entry> allEntries = new ArrayList(); for (java.util.Map.Entry<File, ArrayList<Entry>> mapEntry : dirToEntries.entrySet()) { ArrayList<Entry> dirEntries = mapEntry.getValue(); newOutputDir = outputRoot; else if (!dirEntries.isEmpty()) // newOutputDir = dirEntries.get(0).outputDir; String outputName = inputDir.getName(); if (outputSuffix != null) outputName = outputName.replaceAll("(.*)\\..*", "$1") + outputSuffix; throw new Exception("Error processing directory: " + entry.inputFile.getAbsolutePath(), ex); allEntries.addAll(dirEntries);
public KeyframeSet(Keyframe... keyframes) { mNumKeyframes = keyframes.length; mKeyframes = new ArrayList<Keyframe>(); mKeyframes.addAll(Arrays.asList(keyframes)); mFirstKeyframe = mKeyframes.get(0); mLastKeyframe = mKeyframes.get(mNumKeyframes - 1); mInterpolator = mLastKeyframe.getInterpolator(); }
public void attachTo(boolean overrideMainFramebuffer, ViewPort... vps) { if (viewPorts.size() > 0) { for (ViewPort vp : viewPorts) { vp.setOutputFrameBuffer(null); } viewPorts.get(viewPorts.size() - 1).removeProcessor(this); } viewPorts.addAll(Arrays.asList(vps)); viewPorts.get(viewPorts.size() - 1).addProcessor(this); this.attachAsMain = overrideMainFramebuffer; }
private void updateList(ArrayList<String> list, String input) { list.clear(); if (list == rotationWhitelist) { Matcher m = ROTATION_REGEX.matcher(input); while (m.find()) { String rotation = m.group(1).toLowerCase(); if (!list.contains(rotation)) { list.add(rotation); } } } else { list.addAll(Arrays.asList(input.toLowerCase().split(SPLIT_REGEX))); } }
void addAnnotationsTo(Field<?> target, String enclosingNamespace) { if (target.addAnnotations(annotations, true)) { if (refOffset != references.size()) { int size = references.size(); while (refOffset < size) references.get(refOffset++).enclosingNamespace = enclosingNamespace; } } if (!docs.isEmpty()) { target.docs.addAll(docs); docs.clear(); } }
@NotNull @Override public AnAction[] getChildren(@Nullable AnActionEvent e) { if (e == null) { return AnAction.EMPTY_ARRAY; } Project project = e.getProject(); Editor editor = e.getData(CommonDataKeys.EDITOR); if (project == null || editor == null) return AnAction.EMPTY_ARRAY; PsiFile file = PsiUtilBase.getPsiFileInEditor(editor, project); ArrayList<AnAction> children = ContainerUtil.newArrayList(); for (GoTestFramework framework : GoTestFramework.all()) { if (framework.isAvailableOnFile(file)) { children.addAll(framework.getGenerateMethodActions()); } } return !children.isEmpty() ? children.toArray(new AnAction[children.size()]) : AnAction.EMPTY_ARRAY; } }
/** * Removes a collection from the those being decorated in this composite. * * @param coll collection to be removed */ public void removeComposited(Collection coll) { ArrayList list = new ArrayList(this.all.length); list.addAll(Arrays.asList(this.all)); list.remove(coll); this.all = (Collection[]) list.toArray(new Collection[list.size()]); }
private void getCompressMethodFromApk() { ZipFile zipFile = null; try { zipFile = new ZipFile(config.mNewApkFile); ArrayList<String> sets = new ArrayList<>(); sets.addAll(modifiedSet); sets.addAll(addedSet); ZipEntry zipEntry; for (String name : sets) { zipEntry = zipFile.getEntry(name); if (zipEntry != null && zipEntry.getMethod() == ZipEntry.STORED) { storedSet.add(name); } } } catch (Throwable throwable) { } finally { if (zipFile != null) { try { zipFile.close(); } catch (IOException e) { } } } }
private ArrayList<JavaSegment> sortMethodsAndSections (ArrayList<JavaMethod> methods, ArrayList<JniSection> sections) { ArrayList<JavaSegment> segments = new ArrayList<JavaSegment>(); segments.addAll(methods); segments.addAll(sections); Collections.sort(segments, new Comparator<JavaSegment>() { @Override public int compare (JavaSegment o1, JavaSegment o2) { return o1.getStartIndex() - o2.getStartIndex(); } }); return segments; }
process(files, outputRoot, outputRoot, dirToEntries, 0); ArrayList<Entry> allEntries = new ArrayList(); for (java.util.Map.Entry<File, ArrayList<Entry>> mapEntry : dirToEntries.entrySet()) { ArrayList<Entry> dirEntries = mapEntry.getValue(); newOutputDir = outputRoot; else if (!dirEntries.isEmpty()) // newOutputDir = dirEntries.get(0).outputDir; String outputName = inputDir.getName(); if (outputSuffix != null) outputName = outputName.replaceAll("(.*)\\..*", "$1") + outputSuffix; throw new Exception("Error processing directory: " + entry.inputFile.getAbsolutePath(), ex); allEntries.addAll(dirEntries);