congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SynchronizedCollection
Code IndexAdd Tabnine to your IDE (free)

How to use
SynchronizedCollection
in
org.apache.commons.collections.collection

Best Java code snippets using org.apache.commons.collections.collection.SynchronizedCollection (Showing top 17 results out of 315)

origin: commons-collections/commons-collections

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: commons-collections/commons-collections

/**
 * Factory method to create a synchronized collection.
 * 
 * @param coll  the collection to decorate, must not be null
 * @return a new synchronized collection
 * @throws IllegalArgumentException if collection is null
 */
public static Collection decorate(Collection coll) {
  return new SynchronizedCollection(coll);
}

origin: wildfly/wildfly

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: wildfly/wildfly

/**
 * Factory method to create a synchronized collection.
 * 
 * @param coll  the collection to decorate, must not be null
 * @return a new synchronized collection
 * @throws IllegalArgumentException if collection is null
 */
public static Collection decorate(Collection coll) {
  return new SynchronizedCollection(coll);
}

origin: commons-collections/commons-collections

public Collection makeCollection() {
  return SynchronizedCollection.decorate(new ArrayList());
}

origin: org.jboss.eap/wildfly-client-all

/**
 * Factory method to create a synchronized collection.
 * 
 * @param coll  the collection to decorate, must not be null
 * @return a new synchronized collection
 * @throws IllegalArgumentException if collection is null
 */
public static Collection decorate(Collection coll) {
  return new SynchronizedCollection(coll);
}

origin: org.apache.openjpa/openjpa-all

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: org.apache.directory.api/api-ldap-client-all

/**
 * Factory method to create a synchronized collection.
 * 
 * @param coll  the collection to decorate, must not be null
 * @return a new synchronized collection
 * @throws IllegalArgumentException if collection is null
 */
public static Collection decorate(Collection coll) {
  return new SynchronizedCollection(coll);
}

origin: com.github.becauseQA/becauseQA-utils

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Factory method to create a synchronized collection.
 * 
 * @param coll  the collection to decorate, must not be null
 * @return a new synchronized collection
 * @throws IllegalArgumentException if collection is null
 */
public static Collection decorate(Collection coll) {
  return new SynchronizedCollection(coll);
}
 
origin: com.github.becausetesting/commons

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: org.apache.openjpa/openjpa-all

/**
 * Factory method to create a synchronized collection.
 * 
 * @param coll  the collection to decorate, must not be null
 * @return a new synchronized collection
 * @throws IllegalArgumentException if collection is null
 */
public static Collection decorate(Collection coll) {
  return new SynchronizedCollection(coll);
}

origin: org.apache.directory.api/api-ldap-client-all

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Factory method to create a synchronized collection.
 * 
 * @param coll  the collection to decorate, must not be null
 * @return a new synchronized collection
 * @throws IllegalArgumentException if collection is null
 */
public static Collection decorate(Collection coll) {
  return new SynchronizedCollection(coll);
}
 
origin: org.jboss.eap/wildfly-client-all

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Returns a synchronized collection backed by the given collection.
 * <p>
 * You must manually synchronize on the returned buffer's iterator to 
 * avoid non-deterministic behavior:
 *  
 * <pre>
 * Collection c = CollectionUtils.synchronizedCollection(myCollection);
 * synchronized (c) {
 *     Iterator i = c.iterator();
 *     while (i.hasNext()) {
 *         process (i.next());
 *     }
 * }
 * </pre>
 * 
 * This method uses the implementation in the decorators subpackage.
 * 
 * @param collection  the collection to synchronize, must not be null
 * @return a synchronized collection backed by the given collection
 * @throws IllegalArgumentException  if the collection is null
 */
public static Collection synchronizedCollection(Collection collection) {
  return SynchronizedCollection.decorate(collection);
}
org.apache.commons.collections.collectionSynchronizedCollection

Javadoc

Decorates another Collection to synchronize its behaviour for a multi-threaded environment.

Iterators must be manually synchronized:

 
synchronized (coll) { 
Iterator it = coll.iterator(); 
// do stuff with iterator 
} 

This class is Serializable from Commons Collections 3.1.

Most used methods

  • decorate
    Factory method to create a synchronized collection.
  • <init>
    Constructor that wraps (not copies).

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Join (org.hibernate.mapping)
  • Best IntelliJ 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