Vector copyInto - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Vector copyInto method.

This code example shows how to use the following methods:copyInto, size
 
    private static MenuItemObjectManager _instance = null;
    private Vector _menuItemSet = null;
 
    private MenuItemObjectManager() { 
        _menuItemSet = new Vector();
    } 
 
    /** 
     * getInstance of MenuItemObjectManger 
     *  
     * @return instance of MenuItemObjectManager 
     */ 
    public static MenuItemObjectManager getInstance() { 
       if( _instance == null ) {
           _instance = new MenuItemObjectManager();
       } 
        
        return _instance;
    } 

6
CodeRank
This code example shows how to use the following methods:copyInto, size
    private static final Color markerLight = Toolkit.getColor(0xf0f0f0);
    private final Vector views = new Vector();
    private boolean showOutline;
 
    public View[] getSubviews() {
        View[] array = new View[views.size()];
        views.copyInto(array);
        return array;
    } 
 
    protected TestWorkspaceView(final Content content) {
        super(content, new TestWorkspaceSpecification(), null);
    } 
 
    public void debug(DebugString debug) {
        View[] subviews = getSubviews();
        for (int i = 0; i < subviews.length; i++) {
            subviews[i].debug(debug);
            debug.append("\nContent: ");
            debug.append(subviews[i].getContent() == null ? "none" : ("" + subviews[i].getContent().getAdapter()));
6
CodeRank
This code example shows how to use the following methods:add, copyInto, size
	 */ 
	public void setup(GameHelperListener listener, int clientsToUse) {
		mListener = listener;
		mRequestedClients = clientsToUse;
 
		Vector<String> scopesVector = new Vector<String>();
		if (0 != (clientsToUse & CLIENT_GAMES)) {
			scopesVector.add(Scopes.GAMES);
		} 
		if (0 != (clientsToUse & CLIENT_PLUS)) {
			scopesVector.add(Scopes.PLUS_LOGIN);
		} 
		if (0 != (clientsToUse & CLIENT_APPSTATE)) {
			scopesVector.add(Scopes.APP_STATE);
		} 
 
		mScopes = new String[scopesVector.size()];
		scopesVector.copyInto(mScopes);
 
		if (0 != (clientsToUse & CLIENT_GAMES)) {

6
CodeRank
This code example shows how to use the following methods:copyInto, size
    public void addPage(String name) { 
        pages.add(pdf.ref(name)); 
    } 
 
    void close() throws IOException { 
        Object[] kids = new Object[pages.size()]; 
        pages.copyInto(kids); 
        entry("Kids", kids); 
        entry("Count", kids.length); 
        super.close(); 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:copyInto, size
    public void setSubmit(String s) {
        submit = s;
    } 
 
    public String[] getItems() {
        String[] s = new String[v.size()];
        v.copyInto(s);
        return s;
    } 
 
    public void processRequest() { 
        // null value for submit - user hit enter instead of clicking on 
        // "add" or "remove" 
        if (submit == null || submit.equals("add"))
            addItem(item);
        else if (submit.equals("remove"))
            removeItem(item);
 
        // reset at the end of the request 
        reset(); 
6
CodeRank
This code example shows how to use the following methods:copyInto, size
			vector.addElement(array[i]);
		} 
	} 
 
	public int count() { 
		return vector.size();
	} 
 
	public void forEachChild(ChildAction action) {
		Enumeration elements = vector.elements();
		while (elements.hasMoreElements()) {
			Child child = (Child) elements.nextElement();
			action.execute(child);
		} 
	} 
 
	public Child[] toArray() { 
		Child[] array = new Child[count()];
		vector.copyInto(array);
		return array;

5
CodeRank
This code example shows how to use the following methods:addElement, copyInto, size
     * an array of size zero if no flags are set. 
     * 
     * @return	array of Flags.Flag objects representing system flags 
     */ 
    public Flag[] getSystemFlags() { 
	Vector v = new Vector();
	if ((system_flags & ANSWERED_BIT) != 0)
	    v.addElement(Flag.ANSWERED);
	if ((system_flags & DELETED_BIT) != 0)
	    v.addElement(Flag.DELETED);
	if ((system_flags & DRAFT_BIT) != 0)
	    v.addElement(Flag.DRAFT);
	if ((system_flags & FLAGGED_BIT) != 0)
	    v.addElement(Flag.FLAGGED);
	if ((system_flags & RECENT_BIT) != 0)
	    v.addElement(Flag.RECENT);
	if ((system_flags & SEEN_BIT) != 0)
	    v.addElement(Flag.SEEN);
	if ((system_flags & USER_BIT) != 0)
	    v.addElement(Flag.USER);

5
CodeRank
This code example shows how to use the following methods:copyInto, size
     * @return header fields 
     */ 
    public String[] getHeaderFields(String headerName) {
        Field f = (Field) fields.get(headerName.toLowerCase());
        if (f != null) {
            String[] values = new String[f.headerValues.size()];
            f.headerValues.copyInto(values);
            return values;
        } else { 
            return null; 
        } 
    } 
 
    /** 
     * Generate the HTTP protocol text that represents the list of headers 
     * this object contains.   
     *  
     * @param startline start line (i.e. HTTP protocol header) 
     * @return http  
     */ 
5
CodeRank
This code example shows how to use the following methods:copyInto, size
     * @return values 
     */ 
    public String[] getParameterValues(String name) {
        Vector f = (Vector) parameters.get(name);
        if (f != null) {
            String[] values = new String[f.size()];
            f.copyInto(values);
            return values;
        } else { 
            return null; 
        } 
    } 
 
    /** 
     * Get a vector of all the parameter values. <code>null</code> will be 
     * returned if no such parameter exists. 
     *  
     * @param name parameter name 
     * @return values 
     */ 
5
CodeRank
This code example shows how to use the following methods:copyInto, size
	 * Return the parsed tweets. 
	 * </p> 
	 * @return Array of tweets. 
	 */ 
	public Tweet[] getParsedTweets() { 
		Tweet[] ts = new Tweet[dmList.size()];
		dmList.copyInto(ts);
		// 
		return ts;
	} 
	 
	/** 
	 * <p> 
	 * Load the parsed values, from a given index, into the given tweet. 
	 * </p> 
	 * @param dm Tweet to be loaded. 
	 * @param index Tweet's index which values will be copied into given tweet. 
	 */ 
	public void loadParsedTweet(Tweet dm, int index) {
		dm.setData((Tweet)dmList.elementAt(index));
5
CodeRank
copyInto Method Overview
Copies the components of this vector into the specified array.
See Code Examples for other Java 8 Vector Methods: