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

How to use
addComposited
method
in
org.apache.commons.collections.collection.CompositeCollection

Best Java code snippets using org.apache.commons.collections.collection.CompositeCollection.addComposited (Showing top 20 results out of 315)

origin: commons-collections/commons-collections

/**
 * Create a Composite Collection with only coll composited.
 * 
 * @param coll  a collection to decorate
 */
public CompositeCollection(Collection coll) {
  this();
  this.addComposited(coll);
}

origin: commons-collections/commons-collections

/**
 * Create a CompositeCollection with colls as the initial list of
 * composited collections.
 * 
 * @param colls  an array of collections to decorate
 */
public CompositeCollection(Collection[] colls) {
  this();
  this.addComposited(colls);
}

origin: commons-collections/commons-collections

/**
 * Add an additional collection to this composite.
 * 
 * @param c  the collection to add
 */
public void addComposited(Collection c) {
  this.addComposited(new Collection[]{c});
}

origin: commons-collections/commons-collections

/**
 * Add two additional collections to this composite.
 * 
 * @param c  the first collection to add
 * @param d  the second collection to add
 */
public void addComposited(Collection c, Collection d) {
  this.addComposited(new Collection[]{c, d});
}

origin: wildfly/wildfly

/**
 * Add two additional collections to this composite.
 * 
 * @param c  the first collection to add
 * @param d  the second collection to add
 */
public void addComposited(Collection c, Collection d) {
  this.addComposited(new Collection[]{c, d});
}

origin: wildfly/wildfly

/**
 * Create a CompositeCollection with colls as the initial list of
 * composited collections.
 * 
 * @param colls  an array of collections to decorate
 */
public CompositeCollection(Collection[] colls) {
  this();
  this.addComposited(colls);
}

origin: wildfly/wildfly

/**
 * Create a Composite Collection with only coll composited.
 * 
 * @param coll  a collection to decorate
 */
public CompositeCollection(Collection coll) {
  this();
  this.addComposited(coll);
}

origin: wildfly/wildfly

/**
 * Add an additional collection to this composite.
 * 
 * @param c  the collection to add
 */
public void addComposited(Collection c) {
  this.addComposited(new Collection[]{c});
}

origin: commons-collections/commons-collections

public void testMultipleCollectionsSize() {
  setUpTest();
  HashSet set = new HashSet();
  set.add("a");
  set.add("b");
  c.addComposited(set);
  HashSet other = new HashSet();
  other.add("c");
  c.addComposited(other);
  assertEquals(set.size() + other.size(), c.size());
}

origin: commons-collections/commons-collections

/**
 * Full collection consists of 4 collections, each with one element
 */
public Collection makeFullCollection() {
  CompositeCollection compositeCollection = new CompositeCollection();
  Object[] elements = getFullElements();
  for (int i = 0; i < elements.length; i++) {
    Collection summand = new HashSet();
    summand.add(elements[i]);
    compositeCollection.addComposited(summand);
  }
  return compositeCollection;
}

origin: commons-collections/commons-collections

public void testSize() {
  setUpTest();
  HashSet set = new HashSet();
  set.add("a");
  set.add("b");
  c.addComposited(set);
  assertEquals(set.size(), c.size());
}

origin: commons-collections/commons-collections

public void testAddAllToCollection() {
  setUpTest();
  one.add("1");
  two.add("2");
  c.addComposited(one, two);
  Collection toCollection = new HashSet();
  toCollection.addAll(c);
  assertTrue(toCollection.containsAll(c));
  assertEquals(c.size(), toCollection.size());
}   

origin: commons-collections/commons-collections

public void testContainsAll() {
  setUpTest();
  one.add("1");
  two.add("1");
  c.addComposited(one);
  assertTrue(c.containsAll(two));
}

origin: commons-collections/commons-collections

public void testToCollection() {
  setUpTest();
  one.add("1");
  two.add("2");
  c.addComposited(one, two);
  Collection foo = c.toCollection();
  assertTrue(foo.containsAll(c));
  assertEquals(c.size(), foo.size());
  one.add("3");
  assertTrue(!foo.containsAll(c));
}

origin: commons-collections/commons-collections

public void testRemove() {
  setUpMutatorTest();
  one.add("1");
  two.add("2");
  two.add("1");
  c.addComposited(one, two);
  c.remove("1");
  assertTrue(!c.contains("1"));
  assertTrue(!one.contains("1"));
  assertTrue(!two.contains("1"));
}

origin: commons-collections/commons-collections

public void testRemoveAll() {
  setUpMutatorTest();
  one.add("1");
  two.add("2");
  two.add("1");
  c.addComposited(one, two);
  c.removeAll(one);
  assertTrue(!c.contains("1"));
  assertTrue(!one.contains("1"));
  assertTrue(!two.contains("1"));
}

origin: commons-collections/commons-collections

public void testClear() {
  setUpTest();
  one.add("1");
  two.add("2");
  c.addComposited(one, two);
  c.clear();
  assertTrue(one.isEmpty());
  assertTrue(two.isEmpty());
  assertTrue(c.isEmpty());
}

origin: commons-collections/commons-collections

  public void testRemoveComposited() {
    setUpMutatorTest();
    one.add("1");
    two.add("2");
    two.add("1");
    c.addComposited(one, two);    
    c.removeComposited(one);
    assertTrue(c.contains("1"));
    assertEquals(c.size(), 2);
  }
}
origin: commons-collections/commons-collections

public void testRetainAll() {
  setUpTest();
  one.add("1");
  one.add("2");
  two.add("1");
  c.addComposited(one);
  c.retainAll(two);
  assertTrue(!c.contains("2"));
  assertTrue(!one.contains("2"));
  assertTrue(c.contains("1"));
  assertTrue(one.contains("1"));
}

origin: commons-collections/commons-collections

public void testIsEmpty() {
  setUpTest();
  assertTrue(c.isEmpty());
  HashSet empty = new HashSet();
  c.addComposited(empty);
  assertTrue(c.isEmpty());
  empty.add("a");
  assertTrue(!c.isEmpty());
}

org.apache.commons.collections.collectionCompositeCollectionaddComposited

Javadoc

Add an additional collection to this composite.

Popular methods of CompositeCollection

  • <init>
    Create a CompositeCollection with colls as the initial list of composited collections.
  • contains
    Checks whether this composite collection contains the object. This implementation calls contains() o
  • iterator
    Gets an iterator over all the collections in this composite. This implementation uses an IteratorCha
  • setMutator
    Specify a CollectionMutator strategy instance to handle changes.
  • size
    Gets the size of this composite collection. This implementation calls size() on each collection.
  • add
    Adds an object to the collection, throwing UnsupportedOperationException unless a CollectionMutator
  • addAll
    Adds a collection of elements to this collection, throwing UnsupportedOperationException unless a Co
  • clear
    Removes all of the elements from this collection . This implementation calls clear() on each collect
  • containsAll
    Checks whether this composite contains all the elements in the specified collection. This implementa
  • isEmpty
    Checks whether this composite collection is empty. This implementation calls isEmpty() on each colle
  • remove
    Removes an object from the collection, throwing UnsupportedOperationException unless a CollectionMut
  • removeAll
    Removes the elements in the specified collection from this composite collection. This implementatio
  • remove,
  • removeAll,
  • removeComposited,
  • retainAll,
  • toCollection

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Github Copilot alternatives
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