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


   1: 
   2: import java.util.ArrayList;
   3: import java.util.concurrent.CountDownLatch;
   4:         ...
   5:     
   6:     private ArrayList results_ = new ArrayList();
   7:     
   8:         ...
   9:     public Object[] getResults() {
  10:         return results_.toArray();
  11:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     private static final long serialVersionUID = 1L;
   6:     protected ArrayList children= new ArrayList();
   7:     public BookmarkFolder() {
   8:         ...
   9:     public Object[] getChildren(Object parent) {
  10:         return children.toArray();
  11:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public GoalDiscoveryResult() {
   6:         this.goalDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public GoalDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.goalDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public Object[] toArray() { 
  14:         return goalDiscoveryResults.toArray();

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

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public ServiceDiscoveryResult() {
   6:         this.serviceDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public ServiceDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.serviceDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public Object[] toArray() {
  14:         return serviceDiscoveryResults.toArray();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public KeywordDiscoveryResult() {
   6:         this.keywordDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public KeywordDiscoveryResult(ArrayList keywordDiscoveryResults) {
  11:         this.keywordDiscoveryResults = keywordDiscoveryResults;
  12:         ...
  13:     public Object[] toArray() { 
  14:         return keywordDiscoveryResults.toArray();

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

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public WebServiceDiscoveryResult() {
   6:         this.webServiceDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public WebServiceDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.webServiceDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public Object[] toArray() {
  14:         return webServiceDiscoveryResults.toArray();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5:         Iterator itr = items.iterator();
   6:         ArrayList newlist = new ArrayList();
   7:         while (itr.hasNext()) {
   8:         ...
   9:         if (newlist.size() > 0) {
  10:             return newlist.toArray();
  11:         } else {

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:         ModelNode[] nodes = getNodes(getRootNode().getElement());
   6:         ArrayList result = new ArrayList();
   7:         if (nodes != null)
   8:         ...
   9:             
  10:             return result.toArray();
  11:         }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:             Object []children = adapter.getChildren(parentElement);
   6:             ArrayList filtered = new ArrayList();
   7:             for (int i = 0; i < children.length; i++) {
   8:         ...
   9:             }
  10:             return filtered.toArray();
  11:         }

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     public Object[] findSourceElements(String path) throws CoreException {
   6:         ArrayList sources = new ArrayList();
   7:         File osFile = new File(path);
   8:         ...
   9:         }
  10:         return sources.toArray();
  11:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:             
   6:             ArrayList accessibleProjects = new ArrayList();
   7:             for (int i = 0; i < allProjects.length; i++) {
   8:         ...
   9:             }
  10:             return accessibleProjects.toArray();
  11:         }

View Full Code Here
   1:             return new Object[0];
   2:         ArrayList results = new ArrayList(getSize());
   3:         Iterator iter = internal.values().iterator();
   4:         ...
   5:         }
   6:         return results.toArray();
   7:     }
   8: 
   9:     public void clear() {

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5:     public Object[] getChildren() {
   6:         ArrayList children = new ArrayList();
   7:         Project project = getProject();
   8:         ...
   9:         }
  10:         return children.toArray();
  11:     }

View Full Code Here