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

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

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

origin: commons-collections/commons-collections

/**
 * Returns an array containing all of the elements in this composite.
 *
 * @return an object array of all the elements in the collection
 */
public Object[] toArray() {
  final Object[] result = new Object[this.size()];
  int i = 0;
  for (Iterator it = this.iterator(); it.hasNext(); i++) {
    result[i] = it.next();
  }
  return result;
}

origin: wildfly/wildfly

/**
 * Returns an array containing all of the elements in this composite.
 *
 * @return an object array of all the elements in the collection
 */
public Object[] toArray() {
  final Object[] result = new Object[this.size()];
  int i = 0;
  for (Iterator it = this.iterator(); it.hasNext(); i++) {
    result[i] = it.next();
  }
  return result;
}

origin: commons-collections/commons-collections

/**
 * Returns an object array, populating the supplied array if possible.
 * See <code>Collection</code> interface for full details.
 *
 * @param array  the array to use, populating if possible
 * @return an array of all the elements in the collection
 */
public Object[] toArray(Object[] array) {
  int size = this.size();
  Object[] result = null;
  if (array.length >= size) {
    result = array;
  }
  else {
    result = (Object[]) Array.newInstance(array.getClass().getComponentType(), size);
  }
  
  int offset = 0;
  for (int i = 0; i < this.all.length; ++i) {
    for (Iterator it = this.all[i].iterator(); it.hasNext();) {
      result[offset++] = it.next();
    }
  }
  if (result.length > size) {
    result[size] = null;
  }
  return result;
}

origin: wildfly/wildfly

/**
 * Returns an object array, populating the supplied array if possible.
 * See <code>Collection</code> interface for full details.
 *
 * @param array  the array to use, populating if possible
 * @return an array of all the elements in the collection
 */
public Object[] toArray(Object[] array) {
  int size = this.size();
  Object[] result = null;
  if (array.length >= size) {
    result = array;
  }
  else {
    result = (Object[]) Array.newInstance(array.getClass().getComponentType(), size);
  }
  
  int offset = 0;
  for (int i = 0; i < this.all.length; ++i) {
    for (Iterator it = this.all[i].iterator(); it.hasNext();) {
      result[offset++] = it.next();
    }
  }
  if (result.length > size) {
    result[size] = null;
  }
  return result;
}

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 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

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 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 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: org.apache.directory.api/api-ldap-client-all

/**
 * Returns an array containing all of the elements in this composite.
 *
 * @return an object array of all the elements in the collection
 */
public Object[] toArray() {
  final Object[] result = new Object[this.size()];
  int i = 0;
  for (Iterator it = this.iterator(); it.hasNext(); i++) {
    result[i] = it.next();
  }
  return result;
}

origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Returns an array containing all of the elements in this composite.
 *
 * @return an object array of all the elements in the collection
 */
public Object[] toArray() {
  final Object[] result = new Object[this.size()];
  int i = 0;
  for (Iterator it = this.iterator(); it.hasNext(); i++) {
    result[i] = it.next();
  }
  return result;
}
 
origin: org.apache.openjpa/openjpa-all

/**
 * Returns an array containing all of the elements in this composite.
 *
 * @return an object array of all the elements in the collection
 */
public Object[] toArray() {
  final Object[] result = new Object[this.size()];
  int i = 0;
  for (Iterator it = this.iterator(); it.hasNext(); i++) {
    result[i] = it.next();
  }
  return result;
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Returns an array containing all of the elements in this composite.
 *
 * @return an object array of all the elements in the collection
 */
public Object[] toArray() {
  final Object[] result = new Object[this.size()];
  int i = 0;
  for (Iterator it = this.iterator(); it.hasNext(); i++) {
    result[i] = it.next();
  }
  return result;
}
 
origin: org.jboss.eap/wildfly-client-all

/**
 * Returns an array containing all of the elements in this composite.
 *
 * @return an object array of all the elements in the collection
 */
public Object[] toArray() {
  final Object[] result = new Object[this.size()];
  int i = 0;
  for (Iterator it = this.iterator(); it.hasNext(); i++) {
    result[i] = it.next();
  }
  return result;
}

origin: org.apache.openjpa/openjpa-all

/**
 * Returns an object array, populating the supplied array if possible.
 * See <code>Collection</code> interface for full details.
 *
 * @param array  the array to use, populating if possible
 * @return an array of all the elements in the collection
 */
public Object[] toArray(Object[] array) {
  int size = this.size();
  Object[] result = null;
  if (array.length >= size) {
    result = array;
  }
  else {
    result = (Object[]) Array.newInstance(array.getClass().getComponentType(), size);
  }
  
  int offset = 0;
  for (int i = 0; i < this.all.length; ++i) {
    for (Iterator it = this.all[i].iterator(); it.hasNext();) {
      result[offset++] = it.next();
    }
  }
  if (result.length > size) {
    result[size] = null;
  }
  return result;
}

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

/**
 * Returns an object array, populating the supplied array if possible.
 * See <code>Collection</code> interface for full details.
 *
 * @param array  the array to use, populating if possible
 * @return an array of all the elements in the collection
 */
public Object[] toArray(Object[] array) {
  int size = this.size();
  Object[] result = null;
  if (array.length >= size) {
    result = array;
  }
  else {
    result = (Object[]) Array.newInstance(array.getClass().getComponentType(), size);
  }
  
  int offset = 0;
  for (int i = 0; i < this.all.length; ++i) {
    for (Iterator it = this.all[i].iterator(); it.hasNext();) {
      result[offset++] = it.next();
    }
  }
  if (result.length > size) {
    result[size] = null;
  }
  return result;
}

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

/**
 * Returns an object array, populating the supplied array if possible.
 * See <code>Collection</code> interface for full details.
 *
 * @param array  the array to use, populating if possible
 * @return an array of all the elements in the collection
 */
public Object[] toArray(Object[] array) {
  int size = this.size();
  Object[] result = null;
  if (array.length >= size) {
    result = array;
  }
  else {
    result = (Object[]) Array.newInstance(array.getClass().getComponentType(), size);
  }
  
  int offset = 0;
  for (int i = 0; i < this.all.length; ++i) {
    for (Iterator it = this.all[i].iterator(); it.hasNext();) {
      result[offset++] = it.next();
    }
  }
  if (result.length > size) {
    result[size] = null;
  }
  return result;
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Returns an object array, populating the supplied array if possible.
 * See <code>Collection</code> interface for full details.
 *
 * @param array  the array to use, populating if possible
 * @return an array of all the elements in the collection
 */
public Object[] toArray(Object[] array) {
  int size = this.size();
  Object[] result = null;
  if (array.length >= size) {
    result = array;
  }
  else {
    result = (Object[]) Array.newInstance(array.getClass().getComponentType(), size);
  }
  
  int offset = 0;
  for (int i = 0; i < this.all.length; ++i) {
    for (Iterator it = this.all[i].iterator(); it.hasNext();) {
      result[offset++] = it.next();
    }
  }
  if (result.length > size) {
    result[size] = null;
  }
  return result;
}
 
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Returns an object array, populating the supplied array if possible.
 * See <code>Collection</code> interface for full details.
 *
 * @param array  the array to use, populating if possible
 * @return an array of all the elements in the collection
 */
public Object[] toArray(Object[] array) {
  int size = this.size();
  Object[] result = null;
  if (array.length >= size) {
    result = array;
  }
  else {
    result = (Object[]) Array.newInstance(array.getClass().getComponentType(), size);
  }
  
  int offset = 0;
  for (int i = 0; i < this.all.length; ++i) {
    for (Iterator it = this.all[i].iterator(); it.hasNext();) {
      result[offset++] = it.next();
    }
  }
  if (result.length > size) {
    result[size] = null;
  }
  return result;
}
 
org.apache.commons.collections.collectionCompositeCollectionsize

Javadoc

Gets the size of this composite collection.

This implementation calls size() on each collection.

Popular methods of CompositeCollection

  • <init>
    Create a CompositeCollection with colls as the initial list of composited collections.
  • addComposited
    Add these Collections to the list of collections in this composite
  • 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.
  • 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)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Table (org.hibernate.mapping)
    A relational table
  • CodeWhisperer 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