Demos and Usage of java.util.Collection.toArray()


   1: 
   2: import java.util.Collection;
   3: 
   4:         ...
   5:     public static Object getSelection(IGUISeSAmDeclaration guiSeSAmDeclaration,
   6:             String title, Object message, Collection options, Object _default) 
   7:     {        
   8:         ...
   9:                 null,
  10:                 options.toArray(),
  11:                 _default);

View Full Code Here
   1: import java.beans.PropertyDescriptor;
   2: import java.util.Collection;
   3: 
   4:         ...
   5: 
   6:     public void setChoices(Collection choices) {
   7:         ...
   8:         comboBox.setModel(new DefaultComboBoxModel(choices.toArray()));
   9:     }

View Full Code Here
   1: import java.io.*;
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6: public final class SynchronizedCollection implements Collection, Serializable {
   7:     private static final long serialVersionUID = 3053995032091335093L;
   8:         ...
   9: 
  10:     public SynchronizedCollection(Collection c) {
  11:         if (c==null)
  12:         ...
  13:     public final Object[] toArray() {
  14:         synchronized(mutex) {return c.toArray();}

View Full Code Here
   1: 
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: public class CollectionDelegate
   6:   implements Collection
   7: {
   8:         ...
   9:   protected Collection inner;
  10: 
  11:         ...
  12:   public int size() { return inner.size(); }
  13:   public Object[] toArray() { return inner.toArray(); }

View Full Code Here
   1: import edu.emory.mathcs.backport.java.util.concurrent.locks.*;
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6: public final class SCollection implements Collection {
   7:         ...
   8:     private final Collection c;
   9:     private final ReentrantLock l = new ReentrantLock();
  10:         ...
  11:     public final Object[] toArray() {
  12:         l.lock(); try  {return c.toArray();} finally { l.unlock(); }

View Full Code Here
   1: import java.lang.reflect.Array;
   2: import java.util.Collection;
   3: 
   4:         ...
   5: 
   6:     public static StringBuffer join( Collection collection, StringBuffer buf, String prefix, String postfix ) {
   7:         ...
   8:         return join(collection.toArray(), buf, prefix, postfix);
   9:     }
  10:         ...
  11:                                      String prefix, String separator, String postfix ) {
  12:         return join(collection.toArray(), buf, prefix, separator, postfix);

View Full Code Here
   1: 
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6: public class ReadOnlyCollection implements Collection {
   7:         ...
   8:   private Collection inner;
   9: 
  10:         ...
  11:   public int hashCode() { return inner.hashCode(); }
  12:   public Object[] toArray() { return inner.toArray(); }

View Full Code Here
   1: 
   2: import java.util.Collection;
   3: import java.util.ArrayList;
   4:         ...
   5:   final int[] _references_addresses;
   6:   private Collection _references = new ArrayList();
   7:         ...
   8:   private Collection _referees = new ArrayList();
   9: 
  10:         ...
  11:   public Object[] get_references() {
  12:     return _references.toArray();

View Full Code Here
   1: {
   2:     static Collection synchronizedCollection(Collection c, Object mutex) {
   3:     return new SynchronizedCollection(c, mutex);
   4:         ...
   5: 
   6:     static class SynchronizedCollection implements Collection, Serializable {
   7:     private static final long serialVersionUID = 3053995032091335093L;
   8:         ...
   9:     public Object[] toArray() {
  10:         synchronized(mutex) {return c.toArray();}
  11:         }

View Full Code Here
   1: 
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6: public class JDOResultCollection implements Collection
   7: {
   8:         ...
   9:     Query q;
  10:     Collection queryresult;
  11:     HashSet iterators;
  12:         ...
  13:     public Object[] toArray() {
  14:         return queryresult.toArray();

View Full Code Here
   1: import edu.emory.mathcs.backport.java.util.concurrent.locks.*;
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6: public final class RWCollection implements Collection {
   7:         ...
   8:     private final Collection c;
   9:     private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
  10:         ...
  11:         final ReentrantReadWriteLock.ReadLock l =  (ReentrantReadWriteLock.ReadLock)rwl.readLock();
  12:         l.lock(); try  {return c.toArray();} finally { l.unlock(); }

View Full Code Here
   1: import java.util.ArrayList;
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     protected Collection innerCollection;
   7: 
   8:         ...
   9: 
  10:     public SecurityRoleSetImpl(Collection collection) {
  11:         innerCollection = collection;
  12:         ...
  13:     public Object[] toArray() {
  14:         return innerCollection.toArray();

View Full Code Here
   1: import java.sql.Savepoint;
   2: import java.util.Collection;
   3: 
   4:         ...
   5:     public int executeBatch(String statementID, String batchParameterName,
   6:             Collection batchParameters) throws BrokerException,
   7:             ConstraintException, DeadlockException {
   8:         ...
   9:         int[] counts = executeBatch(statementID, batchParameterName,
  10:                 batchParameters.toArray());
  11:         int totalCount = 0;

View Full Code Here
   1: import java.util.ArrayList;
   2: import java.util.Collection;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     protected Collection innerCollection;
   7: 
   8:         ...
   9: 
  10:     public SecurityRoleRefSetImpl(Collection collection)
  11:     {
  12:         ...
  13:     {        
  14:         return innerCollection.toArray();

View Full Code Here
   1: import java.util.ArrayList;
   2: import java.util.Collection;
   3: 
   4:         ...
   5: 
   6:     private Collection statuses = new ArrayList();
   7: 
   8:         ...
   9:             public Object[] getElements(Object inputElement) {
  10:                 return statuses.toArray();
  11:             }

View Full Code Here