List of usage examples for java.util List addAll
boolean addAll(Collection<? extends E> c);
From source file:ca.uviccscu.lp.persistence.GamelistStorage.java
public static synchronized List getAllGames() { List ll = new LinkedList(); Collection c = stringToGameMap.values(); ll.addAll(c); return ll;// ww w . j a v a2s.c om }
From source file:com.logsniffer.web.tags.JstlFunctionsLibrary.java
/** * Merges to lists into one./*w ww . j a v a 2s . c o m*/ * * @param col1 * @param col2 * @return */ public static List<Object> mergeLists(final List<Object> col1, final List<Object> col2) { final List<Object> m = new ArrayList<>(); m.addAll(col1); m.addAll(col2); return m; }
From source file:at.porscheinformatik.sonarqube.licensecheck.LicenseCheckMeasureComputer.java
private static void addLicenseMeasure(final List<License> licensesWithChildren, final Measure measure) { if (measure != null && StringUtils.isNotBlank(measure.getStringValue())) { licensesWithChildren.addAll(License.fromString(measure.getStringValue())); }//from ww w. j a va 2 s. c o m }
From source file:org.intellij.plugins.beans.PluginContext.java
public static List getComponents(Application application, Project project) { List list = getComponents(project); list.addAll(getComponents(application)); list.add(CodeStyleManager.getInstance(project)); list.add(JavaCodeStyleManager.getInstance(project)); list.add(PsiManager.getInstance(project)); list.add(ProjectRootManager.getInstance(project)); list.add(LocalFileSystem.getInstance()); list.add(FileEditorManager.getInstance(project)); list.add(PsiDocumentManager.getInstance(project)); return list;//from w w w . jav a2s .c om }
From source file:at.porscheinformatik.sonarqube.licensecheck.LicenseCheckMeasureComputer.java
private static void addDependencyMeasure(final List<Dependency> dependencyWithChildren, final Measure measure) { if (measure != null && StringUtils.isNotBlank(measure.getStringValue())) { dependencyWithChildren.addAll(Dependency.fromString(measure.getStringValue())); }//from w ww . jav a 2 s. c om }
From source file:com.fizzed.stork.launcher.FileUtil.java
static public List<File> findAllFiles(List<String> fileStrings, boolean ignoreNonExistent) throws IOException { List<File> allFiles = new ArrayList<File>(); for (String fileString : fileStrings) { List<File> files = FileUtil.findFiles(fileString, ignoreNonExistent); allFiles.addAll(files); }//w ww . ja v a 2s . co m return allFiles; }
From source file:fr.gouv.culture.thesaurus.util.LangUtils.java
@SuppressWarnings("unchecked") public static List<Locale> expand(Locale[] locales) { List<Locale> expandedLocales = new LinkedList<Locale>(); for (Locale locale : locales) { if (locale != null) { expandedLocales.addAll(LocaleUtils.localeLookupList(locale)); } else {//w w w. j av a2 s . c o m expandedLocales.add(null); } } return expandedLocales; }
From source file:com.ibm.watson.developer_cloud.natural_language_classifier.v1.util.TrainingDataUtils.java
/** * Converts a training like argument list to a CSV representation. * /*from w w w . j a v a 2s. c om*/ * @param data * the training data data * @return the string with the CSV representation for the training data */ public static String toCSV(final TrainingData... data) { Validate.notEmpty(data, "data cannot be null or empty"); StringWriter stringWriter = new StringWriter(); try { CSVPrinter printer = new CSVPrinter(stringWriter, CSVFormat.EXCEL); for (TrainingData trainingData : data) { if (trainingData.getText() == null || trainingData.getClasses() == null || trainingData.getClasses().isEmpty()) log.log(Level.WARNING, trainingData + " couldn't be converted to a csv record"); else { List<String> record = new ArrayList<String>(); record.add(trainingData.getText()); record.addAll(trainingData.getClasses()); printer.printRecord(record.toArray()); } } printer.close(); } catch (IOException e) { log.log(Level.SEVERE, "Error creating the csv", e); } return stringWriter.toString(); }
From source file:grails.plugin.searchable.internal.compass.mapping.SearchableGrailsDomainClassCompassMappingUtils.java
/** * Merges the given property mappings, overriding parent mappings with child mappings * @param mappedProperties//from www . j av a2 s . c om * @param parentClassPropertyMappings */ public static void mergePropertyMappings(List mappedProperties, List parentClassPropertyMappings) { if (parentClassPropertyMappings == null) { return; } Assert.notNull(mappedProperties, "mappedProperties cannot be null"); List temp = new ArrayList(parentClassPropertyMappings); temp.addAll(mappedProperties); for (Iterator citer = mappedProperties.iterator(); citer.hasNext();) { CompassClassPropertyMapping cmapping = (CompassClassPropertyMapping) citer.next(); for (Iterator piter = parentClassPropertyMappings.iterator(); piter.hasNext();) { CompassClassPropertyMapping pmapping = (CompassClassPropertyMapping) piter.next(); if (cmapping.getPropertyName().equals(pmapping.getPropertyName())) { temp.remove(pmapping); } } } mappedProperties.clear(); mappedProperties.addAll(temp); }
From source file:com.ccnode.codegenerator.service.SendToServerService.java
public static GenCodeServerRequest buildGenCodeRequest(GenCodeResponse genCodeResponse) { long startTime = System.currentTimeMillis(); try {/*from ww w . j av a 2 s .c om*/ GenCodeServerRequest request = new GenCodeServerRequest(); ServerRequestHelper.fillCommonField(request); List<ChangeInfo> changeInfos = Lists.newArrayList(); if (genCodeResponse.getUpdateFiles() != null) { changeInfos.addAll(genCodeResponse.getUpdateFiles()); } if (genCodeResponse.getNewFiles() != null) { changeInfos.addAll(genCodeResponse.getNewFiles()); } request.setChangeInfos(changeInfos); request.setSettingDto(SettingService.getInstance().getState()); if (genCodeResponse.getThrowable() != null) { request.setStackTraceMsg(Lists.newArrayList(StringUtils .deleteWhitespace(Throwables.getStackTraceAsString(genCodeResponse.getThrowable())))); } return request; } catch (Throwable e) { return null; } }