Vector removeAllElements - 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 removeAllElements method.

This code example shows how to use the following methods:addElement, removeAllElements
	/** 
	 * Adds a new element to download. 
	 */ 
	public void enqueue(RequestedResource resource, BrowserContent referrer) {
		if (browser != referrer) {
			queue.removeAllElements();
			browser = referrer;
		} 
		queue.addElement(resource);
	} 
 
	/** 
	 * Downloads all queued resources. 
	 */ 
	public void run() { 
		if (!queue.isEmpty()) processResource();
		main.invokeLater(this, queue.isEmpty() ? 250 : 1, false);
	} 
 
	private void processResource() { 
7
CodeRank
This code example shows how to use the following methods:addElement, removeAllElements
        sortByColumn(column, true);
    } 
 
    public void sortByColumn(int column, boolean ascending) {
        this.ascending = ascending;
        sortingColumns.removeAllElements();
        sortingColumns.addElement(Integer.valueOf(column));
        sort(this);
        super.tableChanged(new TableModelEvent(this));
    } 
 
    // There is no-where else to put this. 
    // Add a mouse listener to the Table to trigger a table sort 
    // when a column heading is clicked in the JTable. 
    public void addMouseListenerToHeaderInTable(JTable table) {
        final TableSorter sorter = this;
        final JTable tableView = table;
        tableView.setColumnSelectionAllowed(false);
        MouseAdapter listMouseListener = new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
6
CodeRank
This code example shows how to use the following methods:removeAllElements
	/** 
	 * Reset the list for a fresh visitation and collection. 
	 */ 
	public void reset() 
	{ 
		m_refs.removeAllElements(); //.clear();
	} 
	 
	/** 
	 * Get the number of variable references that were collected. 
	 * @return the size of the list. 
	 */ 
	public int getVarCount() 
	{ 
		return m_refs.size();
	} 
	 
	/** 
	 * Tell if the given qualified name occurs in  
	 * the list of qualified names collected. 
5
CodeRank
This code example shows how to use the following methods:removeAllElements
 
    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:removeAllElements
  /** 
   *  Performs the same function as Vector.removeAllElements() 
   **/ 
  public void removeAllElements()  
  { 
    vector.removeAllElements();
  } 
 
  /** 
   *  Performs the same function as Vector.removeElement() 
   **/ 
  public int indexOf(Entry entry) 
  { 
    return vector.indexOf(entry);
  } 
 
  /** 
   *  Performs the same function as Vector.size() 
   **/ 
  public int size()  
5
CodeRank
This code example shows how to use the following methods:removeAllElements
   
  /** 
   * Clear the list of PCShare objects 
   */ 
  public final void clearList() { 
    m_list.removeAllElements(); 
  } 
   
  /** 
   * Return the required PCShare object from the list. 
   * 
   * @return PCShare 
   * @param idx Index of the PCShare to be returned 
   * @exception java.lang.ArrayIndexOutOfBoundsException  If the index is not valid 
   */ 
  public final PCShare getPCShare(int idx) 
    throws ArrayIndexOutOfBoundsException { 
 
    //  Bounds check the index 
 
5
CodeRank
This code example shows how to use the following methods:removeAllElements
   
  /** 
   * Clear the file details from the list 
   */ 
  public final void remoteAllFiles() { 
    m_list.removeAllElements(); 
  } 
} 
5
CodeRank
This code example shows how to use the following methods:removeAllElements
	 
	/** 
	 * Remove all events from the list 
	 */ 
	public final void removeAllEvents() { 
		m_list.removeAllElements(); 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:removeAllElements
	 
	/** 
	 * Remote all items from the list 
	 */ 
	public final void removeAllItems() { 
		m_list.removeAllElements();
	} 
   
  /** 
   * Return the name/value list as a string 
   *  
   * @return String 
   */ 
  public String toString() {
    StringBuffer str = new StringBuffer(256);
     
    str.append("[");
    for ( int i = 0; i < numberOfItems(); i++) {
      if ( str.length() > 1)
        str.append( ",");
5
CodeRank
This code example shows how to use the following methods:removeAllElements
 
  /** 
   * Remove all user accounts from the list. 
   */ 
  public final void removeAllUsers() { 
    m_users.removeAllElements();
  } 
 
  /** 
   * Remvoe the specified user account from the list. 
   * 
   * @param userAcc UserAccount 
   */ 
  public final void removeUser(UserAccount userAcc) {
 
    //	Search for the specified user account 
 
    for (int i = 0; i < m_users.size(); i++) {
      UserAccount acc = m_users.get(i);
      if (acc.getUserName().compareTo(userAcc.getUserName()) == 0) {
5
CodeRank
removeAllElements Method Overview
Removes all components from this vector and sets its size to zero.
See Code Examples for other Java 8 Vector Methods: