Package java.util

Examples of java.util.ArrayList.toArray()


            }
         }
      }

      Attribute[] attrs = new Attribute[attributes.size()];
      attrs = (Attribute[])attributes.toArray(attrs);

      try
      {
         am.updateAttributes(user.getUserName(), attrs);
      }
View Full Code Here


        // gathering up all the files
        List allFiles = new ArrayList();
        File directory = new File(dir);
        addFilesInDirectoryRecursively(directory, allFiles);

        return (File[])allFiles.toArray(new File[allFiles.size()]);

    }
   
    private static void addFilesInDirectoryRecursively(final File directory, final List allFiles) {
        File[] files = directory.listFiles();
View Full Code Here

        PEPeerTransport peer = (PEPeerTransport) iter.next();
        if(peer.getConnectionState() == PEPeerTransport.CONNECTION_FULLY_ESTABLISHED)
          connectedPeers.add(peer);
      }
     
      sortedPeers = (PEPeer[]) connectedPeers.toArray(new PEPeer[connectedPeers.size()]);     
    } finally {
      peers_mon.exit();
    }
   
    if(sortedPeers == null) return;
View Full Code Here

      }
    }
   
    controls = new Control[c.size()];
   
    c.toArray( controls );
  }
 
  public ChangeSelectionActionPerformer(Control[] controls, boolean _reverse_sense) {
    this.controls = controls;
  reverse_sense = _reverse_sense;
View Full Code Here

      }
    }
   
    AERunnable[]  res = new AERunnable[runnables.size()];
     
    runnables.toArray(res);
     
    return( res );
  }
 
  public int
View Full Code Here

         choosableCandidates.add(candidates[i]);
       }
     }

    final LocaleUtilDecoderCandidate[] candidatesToChoose = (LocaleUtilDecoderCandidate[]) choosableCandidates.toArray(new LocaleUtilDecoderCandidate[choosableCandidates.size()]);
    final LocaleUtilDecoderCandidate[] selected_candidate = {null};
       
    // Run Synchronously, since we want the results
    Utils.execSWTThread(new AERunnable() {
      public void runSupport() {
View Full Code Here

    iviews_to_use.add(new TorrentOptionsView());
    if (Logger.isEnabled()) {
      iviews_to_use.add(new LoggerView(true));
    }
   
    final IView[] views = (IView[])iviews_to_use.toArray(new IView[iviews_to_use.size()]);

    for (int i = 0; i < views.length; i++)
    addSection(views[i], manager);

View Full Code Here

              line = reader.readLine();
          }
      } catch (IOException e) {
          throw new TeiidRuntimeException(e);
      }
      return (String[]) result.toArray(new String[result.size()]);
  }
 
}
View Full Code Here

                String key = (String)i.next();
                String value = props.getProperty(key);
                list.add(new Namespace(key, value));
            }
        }
        return (Namespace[]) list.toArray(new Namespace[list.size()]);
    }
   
    public Properties getNamespacesAsProperties() {
        Properties props = (Properties)getProperty(MappingNodeConstants.Properties.NAMESPACE_DECLARATIONS);
        if (props == null) {
View Full Code Here

            Element uriEl = getElement(namespace, MappingNodeConstants.Tags.NAMESPACE_DECLARATION_URI);
            String prefix = (prefixEl != null ? getTextTrim(prefixEl) : MappingNodeConstants.DEFAULT_NAMESPACE_PREFIX);
            String uri = getTextTrim(uriEl);
            namespaces.add(new Namespace(prefix, uri));
        }
        return (Namespace[])namespaces.toArray(new Namespace[namespaces.size()]);
    }
   
    static String getTextTrim(Element element) {
      if (element == null) {
        return null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.