List of usage examples for java.util ArrayList addAll
public boolean addAll(Collection<? extends E> c)
From source file:com.verigreen.common.spring.SpringContextLoader.java
private String[] generateConfigLocations(List<String> additionalLocations) { String[] ecLocations = getLocationsToLoad(); int size = ecLocations.length + additionalLocations.size(); ArrayList<String> newLocations = new ArrayList<>(size); Collections.addAll(newLocations, ecLocations); // this line needs to be at the end so that any mock contexts will override normal contexts newLocations.addAll(additionalLocations); return newLocations.toArray(new String[size]); }
From source file:fr.liglab.adele.cilia.workbench.restmonitoring.service.platform.PlatformRepoService.java
/** * Merge a list of repo element into the current model. Only differences * between the argument and the model are merge back into the model. * //from w ww. ja v a2 s .c o m * @param repoElements * a new model * @return a list of changesets, which can be empty. */ protected List<Changeset> merge(List<PlatformFile> repoElements) throws CiliaException { ArrayList<Changeset> retval = new ArrayList<Changeset>(); retval.addAll(MergeUtil.mergeLists(repoElements, this.repoContent)); // path update for (Changeset c : retval) c.pushPathElement(this); return retval; }
From source file:org.apache.wink.test.mock.SpringAwareTestCase.java
/** * @return application context path, override to change the application * context path construction/*from w ww . j a v a 2 s . c o m*/ */ private String getApplicationContextPath() { ArrayList<String> contextList = new ArrayList<String>(); List<String> additionalContextNames = getAdditionalContextNames(); if (!additionalContextNames.isEmpty()) { contextList.addAll(additionalContextNames); } try { String classPathName = getPackagePath() + File.separator + getClass().getSimpleName() + "Context.xml"; URL resource = getClass().getClassLoader().getResource(classPathName); if (resource != null) { File file = new File(resource.toURI()); if (file.isFile()) { contextList.add(classPathName); } } } catch (URISyntaxException e) { e.printStackTrace(); } StringBuilder buf = new StringBuilder(contextList.get(0)); for (int i = 1; i < contextList.size(); ++i) { buf.append(','); buf.append(contextList.get(i)); } return buf.toString(); }
From source file:com.teambr.modularsystems.core.client.models.BakedCoreExpansion.java
@Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) { // Should only be for in world stuff if (expansion == null && state != null) expansion = (BlockCoreExpansion) state.getBlock(); ArrayList<BakedQuad> quads = new ArrayList<>(); if (parent != null) quads.addAll(parent.getQuads(state, side, rand)); if (side == null) side = EnumFacing.SOUTH;//from w w w . j ava2s. co m BakedQuad bakedQuad = faceBakery.makeBakedQuad(new Vector3f(2.0F, 2.0F, 2.0F), new Vector3f(14.0F, 14.0F, 14.0F), new BlockPartFace(null, 0, "", new BlockFaceUV(new float[] { 0.0F, 0.0F, 16.0F, 16.0F }, 0)), Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry("minecraft:blocks/iron_block"), side, ModelRotation.X0_Y0, null, true, true); int c = expansion.colorMultiplier(); int alpha = c >> 24; if (alpha == 0) alpha = 255; int red = (c >> 16) & 0xFF; int green = (c >> 8) & 0xFF; int blue = c & 0xFF; // New Color int color = red | green << 8 | blue << 16 | alpha << 24; for (int i = 0; i < 4; i++) bakedQuad.getVertexData()[i * 7 + 3] = color; // Add inside Iron Block quads.add(bakedQuad); return quads; }
From source file:io.microprofile.showcase.speaker.persistence.SpeakerDAO.java
/** * Try and fuzzy find the specified Speaker * * @param speaker Speaker to find - may contain partial details * @return Optional matching speakers//w w w.j a v a 2 s.c o m */ public Set<Speaker> find(final Speaker speaker) { final ArrayList<Speaker> speakers = new ArrayList<>(); speakers.addAll(this.speakers.values()); CollectionUtils.filter(speakers, object -> { final Speaker find = Speaker.class.cast(object); return (isMatch(find.getNameFirst(), speaker.getNameFirst()) || isMatch(find.getNameLast(), speaker.getNameLast()) || isMatch(find.getOrganization(), speaker.getOrganization()) || isMatch(find.getTwitterHandle(), speaker.getTwitterHandle())); }); if (!speakers.isEmpty()) { return new HashSet<>(speakers); } return Collections.emptySet(); }
From source file:Game.Player.java
public void discardHand() { ArrayList<Card> handreplica = new ArrayList<>(); handreplica.addAll(hand); for (Card c : handreplica) { deck.used.add(c);/*from ww w . j a v a2s . c om*/ hand.remove(c); } }
From source file:com.viseur.control.MoreSuggestedProjects.java
/** * Handles the HTTP <code>GET</code> method. * * @param request servlet request// ww w . j a v a 2s.co m * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject json = new JSONObject(); int last = Integer.valueOf(request.getParameter("last")); ArrayList<Project> country = new ArrayList<>(); String htmlContent = ""; HttpSession session = request.getSession(); User reg = (User) session.getAttribute("user"); country.addAll(new Investor(reg).getFromInvestorCountry(last)); for (Project proj : country) { htmlContent += "<div class='col-sm-4 col-md-4'><div class='thumbnail'>" + "<h6><span class='label label-default pull-right'>" + proj.categoryName + "</span></h6>" + "<div class='col-item'><div class='photo'><img src='" + VHost.IMGPATH + "/content/logo/" + proj.itemId + ".png' class='img-responsive' alt='' /></div>" + "<div class='info'><div class='row'><div class='price col-sm-12'><div class='separator clear-left'>" + "</div><h4 class=\"text_warap\"><a href='" + VHost.ROOT + "viewproject.jsp?project=" + proj.itemId + "' class='text_warap'>" + proj.title + "</a></h4><p>" + proj.itemShortDesc + "</p></div></div>" + "<div class='separator clear-left'><div class='col-md-6'><h6 class=''><span class='glyphicon glyphicon-eye-open'></span>" + proj.visted + "</h6></div><div class='col-md-6'> <h6 class=''><span class='glyphicon glyphicon-fire'></span> " + proj.buzzedTimes + "</h6></div></div><div class='clearfix'></div></div></div></a></div>"; } json.put("last", last + country.size()); json.put("htmlContent", htmlContent); try (PrintWriter out = response.getWriter()) { out.println(json); out.flush(); } }
From source file:Game.Player.java
public ArrayList<Card> getAllVictoryCards() { int cards;//from w w w .j a v a 2 s . co m ArrayList<Card> victories = new ArrayList<>(); ArrayList<Card> total = new ArrayList<>(); total.addAll(deck.used); total.addAll(deck.content); total.addAll(hand); cards = total.size(); for (Card c : total) { if (c instanceof VictoryCard) { victories.add(c); } } return victories; }
From source file:de.xirp.plugin.PluginManager.java
/** * Gets all plugin instances.<br>//w w w .ja v a2 s .co m * This is every instance for every plugin * * @return all plugins as secure views. * @see SecurePluginView */ @SuppressWarnings("unchecked") private static List<IPlugable> getAllPlugins() { ArrayList<IPlugable> plugins = new ArrayList<IPlugable>(); for (RobotPluginContainer container : robotPlugins.values()) { plugins.addAll(container.getPlugins()); } for (UnrefPluginContainer container : unrefPlugins.values()) { plugins.addAll(container.getAll()); } return plugins; }
From source file:de.betterform.agent.web.utils.SortingWalker.java
private List<File> sortDir(File root) throws IOException { ArrayList<File> resultDirectoriesList = new ArrayList<File>(); ArrayList<File> results = new ArrayList<File>(); //TODO: deep search via depth walk(root, resultDirectoriesList);/*from ww w. ja va2s . c o m*/ Collections.sort(resultDirectoriesList, defaultComparator); results.addAll(resultDirectoriesList); results.addAll(sortFilesInDir(root)); return results; }