Tabnine Logo
Collections.addAll
Code IndexAdd Tabnine to your IDE (free)

How to use
addAll
method
in
java.util.Collections

Best Java code snippets using java.util.Collections.addAll (Showing top 20 results out of 22,230)

Refine searchRefine arrow

  • Vector.toArray
  • Vector.add
  • List.add
  • List.toArray
  • List.size
  • Vector.size
origin: org.powermock/powermock-api-mockito

private void addOtherElementToBeReturned(List<Object> elements, Object[] toBeReturnedOthers) {
  if (toBeReturnedOthers == null) {
    elements.add(toBeReturnedOthers);
    return;
  }
  Collections.addAll(elements, toBeReturnedOthers);
}
origin: robolectric/robolectric

@Override
public void addHeader(Header header) {
 List<Header> temp = new ArrayList<>();
 Collections.addAll(temp, headers);
 temp.add(header);
 headers = temp.toArray(new Header[temp.size()]);
}
origin: stackoverflow.com

 String[] f(String[] first, String[] second) {
  List<String> both = new ArrayList<String>(first.length + second.length);
  Collections.addAll(both, first);
  Collections.addAll(both, second);
  return both.toArray(new String[both.size()]);
}
origin: org.mongodb/mongo-java-driver

private List<List<Double>> convertToListOfLists(final List<Double[]> points) {
  List<List<Double>> listOfLists = new ArrayList<List<Double>>(points.size());
  for (Double[] cur : points) {
    List<Double> list = new ArrayList<Double>(cur.length);
    Collections.addAll(list, cur);
    listOfLists.add(list);
  }
  return listOfLists;
}
origin: org.codehaus.groovy/groovy

public Java8() {
  super();
  List<Class<?>> dgmClasses = new ArrayList<>();
  Collections.addAll(dgmClasses, (Class<?>[]) super.getPluginDefaultGroovyMethods());
  dgmClasses.add(PluginDefaultGroovyMethods.class);
  PLUGIN_DGM = dgmClasses.toArray(new Class<?>[0]);
}
origin: k9mail/k-9

private static Address[] addressFromStringArray(List<String> addresses) {
  ArrayList<Address> result = new ArrayList<>(addresses.size());
  for (String addressStr : addresses) {
    Collections.addAll(result, Address.parseUnencoded(addressStr));
  }
  return result.toArray(new Address[result.size()]);
}
origin: lets-blade/blade

public Ansi and(Ansi other) {
  List<String> both = new ArrayList<String>();
  Collections.addAll(both, codes);
  Collections.addAll(both, other.codes);
  return new Ansi(both.toArray(new String[]{}));
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Gets the current settings of KDtree.
 * 
 * @return an array of strings suitable for passing to setOptions
 */
@Override
public String[] getOptions() {
 Vector<String> result = new Vector<String>();
 result.add("-S");
 result.add(m_Splitter.getClass().getName());
 Collections.addAll(result, super.getOptions());
 return result.toArray(new String[result.size()]);
}
origin: bluelinelabs/LoganSquare

protected Object[] expandStringArgs(Object... args) {
  List<Object> argList = new ArrayList<>();
  for (Object arg : args) {
    if (arg instanceof Object[]) {
      Collections.addAll(argList, (Object[])arg);
    } else {
      argList.add(arg);
    }
  }
  return argList.toArray(new Object[argList.size()]);
}
origin: EngineHub/WorldEdit

      newSequence.add(subInvokable);
    newSequence.add(invokable);
    Collections.addAll(newSequence, ((Sequence) invokable).sequence);
  } else {
    newSequence.add(invokable);
  newValueMap.put(caseValue, newSequence.size());
  Collections.addAll(newSequence, ((Sequence) invokable).sequence);
} else {
  newSequence.add(invokable);
origin: redisson/redisson

/**
 * Returns all methods. Cached. Lazy.
 */
public MethodDescriptor[] getAllMethodDescriptors() {
  if (allMethods == null) {
    List<MethodDescriptor> allMethodsList = new ArrayList<>();
    for (MethodDescriptor[] methodDescriptors : methodsMap.values()) {
      Collections.addAll(allMethodsList, methodDescriptors);
    }
    MethodDescriptor[] allMethods = allMethodsList.toArray(new MethodDescriptor[allMethodsList.size()]);
    Arrays.sort(allMethods, new Comparator<MethodDescriptor>() {
      public int compare(MethodDescriptor md1, MethodDescriptor md2) {
        return md1.getMethod().getName().compareTo(md2.getMethod().getName());
      }
    });
    this.allMethods = allMethods;
  }
  return allMethods;
}
origin: rest-assured/rest-assured

/**
 * Add default filters to apply to each request.
 *
 * @param filter            The filter to add
 * @param additionalFilters An optional array of additional filters to add
 */
public static void filters(Filter filter, Filter... additionalFilters) {
  Validate.notNull(filter, "Filter cannot be null");
  RestAssured.filters.add(filter);
  if (additionalFilters != null) {
    Collections.addAll(RestAssured.filters, additionalFilters);
  }
}
origin: OryxProject/oryx

static Rescorer of(List<Rescorer> rescorers) {
 List<Rescorer> expandedRescorers = new ArrayList<>();
 for (Rescorer rescorer : rescorers) {
  // Assuming at most one level of nesting here
  if (rescorer instanceof MultiRescorer) {
   Collections.addAll(expandedRescorers, ((MultiRescorer) rescorer).getRescorers());
  } else {
   expandedRescorers.add(rescorer);
  }
 }
 return new MultiRescorer(expandedRescorers.toArray(EMPTY_RESCORER_ARRAY));
}
origin: apache/hbase

public ChainWALEntryFilter(List<WALEntryFilter> filters) {
 ArrayList<WALEntryFilter> rawFilters = new ArrayList<>(filters.size());
 // flatten the chains
 for (WALEntryFilter filter : filters) {
  if (filter instanceof ChainWALEntryFilter) {
   Collections.addAll(rawFilters, ((ChainWALEntryFilter) filter).filters);
  } else {
   rawFilters.add(filter);
  }
 }
 this.filters = rawFilters.toArray(new WALEntryFilter[rawFilters.size()]);
 initCellFilters();
}
origin: lets-blade/blade

public Ansi and(Ansi other) {
  List<String> both = new ArrayList<String>();
  Collections.addAll(both, codes);
  Collections.addAll(both, other.codes);
  return new Ansi(both.toArray(new String[]{}));
}
origin: nz.ac.waikato.cms.weka/multiInstanceLearning

/**
 * Gets the current settings of the classifier.
 * 
 * @return an array of strings suitable for passing to setOptions
 */
@Override
public String[] getOptions() {
 Vector<String> result = new Vector<String>();
 result.add("-N");
 result.add("" + m_filterType);
 Collections.addAll(result, super.getOptions());
 return result.toArray(new String[result.size()]);
}
origin: apache/usergrid

private void setServicePackagePrefixes( String packages ) {
  List<String> packagePrefixes = new ArrayList<String>();
  Collections.addAll(packagePrefixes, package_prefixes);
  String[] prefixes = packages.split( ";" );
  for ( String prefix : prefixes ) {
    if ( !packagePrefixes.contains( prefix ) ) {
      packagePrefixes.add( prefix );
    }
  }
  package_prefixes = packagePrefixes.toArray( new String[packagePrefixes.size()] );
}
origin: osmandapp/Osmand

String name = parser.getName();
if (name.equals("poi_category")) {
  lastCategory = new PoiCategory(this, parser.getAttributeValue("", "name"), categories.size());
  lastCategory.setTopVisible(Boolean.parseBoolean(parser.getAttributeValue("", "top")));
  lastCategory.setNotEditableOsm("true".equals(parser.getAttributeValue("", "no_edit")));
  lastCategory.setDefaultTag(parser.getAttributeValue("", "default_tag"));
  if(!Algorithms.isEmpty(parser.getAttributeValue("", "poi_additional_category"))) {
    Collections.addAll(lastCategoryPoiAdditionalsCategories, parser.getAttributeValue("", "poi_additional_category").split(","));
    lastCategoryPoiAdditionalsCategories.removeAll(lastCategory.getExcludedPoiAdditionalCategories());
  categories.add(lastCategory);
} else if (name.equals("poi_filter")) {
  PoiFilter tp = new PoiFilter(this, lastCategory, parser.getAttributeValue("", "name"));
  lastFilterPoiAdditionalsCategories.addAll(lastCategoryPoiAdditionalsCategories);
  if(!Algorithms.isEmpty(parser.getAttributeValue("", "poi_additional_category"))) {
    Collections.addAll(lastFilterPoiAdditionalsCategories, parser.getAttributeValue("", "poi_additional_category").split(","));
      categoryPoiAdditionalMap.put(lastPoiAdditionalCategory, categoryAdditionals);
    categoryAdditionals.add(baseType);
    lastTypePoiAdditionalsCategories.addAll(lastFilterPoiAdditionalsCategories);
    if(!Algorithms.isEmpty(parser.getAttributeValue("", "poi_additional_category"))) {
      Collections.addAll(lastTypePoiAdditionalsCategories, parser.getAttributeValue("", "poi_additional_category").split(","));
origin: jenkinsci/jenkins

public void setInstallations(MavenInstallation... installations) {
  List<MavenInstallation> tmpList = new ArrayList<Maven.MavenInstallation>();
  // remote empty Maven installation : 
  if(installations != null) {
    Collections.addAll(tmpList, installations);
    for(MavenInstallation installation : installations) {
      if(Util.fixEmptyAndTrim(installation.getName()) == null) {
        tmpList.remove(installation);
      }
    }
  }
  this.installations = tmpList.toArray(new MavenInstallation[tmpList.size()]);
  save();
}
origin: spring-projects/spring-framework

/**
 * Create a composite logger that delegates to a primary or falls back on a
 * secondary logger if logging for the primary logger is not enabled.
 * <p>This may be used for fallback logging from lower level packages that
 * logically should log together with some higher level package but the two
 * don't happen to share a suitable parent package (e.g. logging for the web
 * and lower level http and codec packages). For such cases the primary,
 * class-based logger can be wrapped with a shared fallback logger.
 * @param primaryLogger primary logger to try first
 * @param secondaryLogger secondary logger
 * @param tertiaryLoggers optionally, more fallback loggers
 * @return the resulting logger to use
 */
public static Log getCompositeLog(Log primaryLogger, Log secondaryLogger, Log... tertiaryLoggers) {
  List<Log> loggers = new ArrayList<>(2 + tertiaryLoggers.length);
  loggers.add(primaryLogger);
  loggers.add(secondaryLogger);
  Collections.addAll(loggers, tertiaryLoggers);
  return new CompositeLog(loggers);
}
java.utilCollectionsaddAll

Javadoc

Adds all the specified elements to the specified collection.

Popular methods of Collections

  • emptyList
    Returns the empty list (immutable). This list is serializable.This example illustrates the type-safe
  • sort
  • singletonList
    Returns an immutable list containing only the specified object. The returned list is serializable.
  • unmodifiableList
    Returns an unmodifiable view of the specified list. This method allows modules to provide users with
  • emptyMap
    Returns the empty map (immutable). This map is serializable.This example illustrates the type-safe w
  • emptySet
    Returns the empty set (immutable). This set is serializable. Unlike the like-named field, this metho
  • unmodifiableMap
    Returns an unmodifiable view of the specified map. This method allows modules to provide users with
  • singleton
    Returns an immutable set containing only the specified object. The returned set is serializable.
  • unmodifiableSet
    Returns an unmodifiable view of the specified set. This method allows modules to provide users with
  • singletonMap
    Returns an immutable map, mapping only the specified key to the specified value. The returned map is
  • reverse
    Reverses the order of the elements in the specified list. This method runs in linear time.
  • unmodifiableCollection
    Returns an unmodifiable view of the specified collection. This method allows modules to provide user
  • reverse,
  • unmodifiableCollection,
  • shuffle,
  • enumeration,
  • list,
  • synchronizedMap,
  • synchronizedList,
  • reverseOrder,
  • emptyIterator

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Runner (org.openjdk.jmh.runner)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now