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

This code example shows how to use the following methods:add, contains, remove, trimToSize
  * Ensure order is changed 
  * 
  */ 
  public void setLastIndex(Object anObject)
  { 
    if(order.contains(anObject))
    { 
      order.remove(anObject);
      order.trimToSize();
      order.add(anObject);
    } 
  } 
     
   
  /** 
  * 
  * Determine if a return page is stored 
  * @return 	true if a return page available 
  * 
  */ 
7
CodeRank
This code example shows how to use the following methods:push, isEmpty, lastElement, remove, size
    return ""; 
  } 
 
  protected void kP(String paramString)
  { 
    if (!this.hrs.isEmpty()) {
      String str = (String)this.hrs.lastElement();
      if ((str == null) || (!str.equals(paramString)))
      { 
        if (this.hrs.size() >= 100)
          this.hrs.remove(this.hrs.lastElement());
        this.hrs.push(paramString);
      } 
    } else { 
      this.hrs.push(paramString);
    } 
    this.hrt = this.hrs.listIterator(this.hrs.size());
  } 
} 

6
CodeRank
This code example shows how to use the following methods:contains, indexOf, remove, setElementAt
        } 
        return null; 
    } 
 
    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
        if (mChildNodes.contains(oldChild)) {
            // Try to remove the new child if available 
            try { 
                mChildNodes.remove(newChild);
            } catch (DOMException e) {
                // Ignore exception 
            } 
            mChildNodes.setElementAt(newChild, mChildNodes.indexOf(oldChild));
            ((NodeImpl)newChild).setParentNode(this);
            ((NodeImpl)oldChild).setParentNode(null);
        } else { 
            throw new DOMException(DOMException.NOT_FOUND_ERR, "Old child does not exist");
        } 
        return oldChild;
    } 
7
CodeRank
This code example shows how to use the following methods:contains, indexOf, remove
        } 
        return null; 
    } 
 
    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
        if (mChildNodes.contains(oldChild)) {
            // Try to remove the new child if available 
            try { 
                mChildNodes.remove(newChild);
            } catch (DOMException e) {
                // Ignore exception 
            } 
            mChildNodes.setElementAt(newChild, mChildNodes.indexOf(oldChild));
            ((NodeImpl)newChild).setParentNode(this);
            ((NodeImpl)oldChild).setParentNode(null);
        } else { 
            throw new DOMException(DOMException.NOT_FOUND_ERR, "Old child does not exist");
        } 
        return oldChild;
    } 
6
CodeRank
This code example shows how to use the following methods:add, contains, remove
		return _names.elements();
	} 
 
	@Override 
	public Object put(Object key, Object value) { 
		if (_names.contains(key)) {
			_names.remove(key);
		} 
 
		_names.add((String)key);
 
		return super.put(key, value); 
	} 
 
	@Override 
	public Object remove(Object key) { 
		_names.remove(key);
 
		return super.remove(key); 
	} 
7
CodeRank
This code example shows how to use the following methods:add, contains, indexOf, remove
   * @param p           the printstream to add 
   * @param timestamp   whether to use timestamps or not 
   * @param prefix      the prefix to use 
   */ 
  public void add(PrintStream p, boolean timestamp, String prefix) {
    if (m_Streams.contains(p))
      remove(p);
 
    // make sure it's not null 
    if (prefix == null)
      prefix = "";
 
    m_Streams.add(p);
    m_Timestamps.add(new Boolean(timestamp));
    m_Prefixes.add(prefix);
  } 
 
  /** 
   * returns the specified PrintStream from the list 
   *  

6
CodeRank
This code example shows how to use the following methods:sleep, add, remove
 
    /** 
     * @param args ignored 
     */ 
    public static void main(String[] args) {
        Vector<String> list = new Vector<String>();
        list.add("one");
        list.add("two");
        list.add("three");
        list.add("four");
 
        new Thread(new SharedListTask(list)).start();
 
        try { Thread.sleep(2000); }
        catch (InterruptedException e) { /* ignore */}
 
        // the data structure is fully synchronized, 
        // but that only protects the individual methods! 
        list.remove("three");
    } 

7
CodeRank
This code example shows how to use the following methods:lastElement, remove
      this.queueVector.remove(object);
   } 
 
   protected synchronized Object removeLast()
   { 
      Object object = this.queueVector.lastElement();
      this.queueVector.remove(object);
      return object;
   } 
} 
6
CodeRank
This code example shows how to use the following methods:add, clear, isEmpty, remove
     * play the sound loaded to the SoundPool by the key we set 
     * @param key  the key in the map 
     */ 
    public void playSound(String key) {
        stopSound(); 
        mSoundQueue.add(key);
        playNextSound(); 
    } 
    
	/** 
	 * play the sounds have loaded in SoundPool 
	 * @param keys the files key stored in the map 
	 * @throws InterruptedException 
	 */ 
    public void playSeqSounds(String keys[]) {
    	//stopSound(); 
    	for(String key : keys) {
    		mSoundQueue.add(key);
    	} 
    	if (!mPlaying)

6
CodeRank
This code example shows how to use the following methods:add, remove, size
 
            if (valueCommitted) {
                valueCommitted = false;
                lifeHistory.add(newLifeString.toString());
            } else { 
                lifeHistory.remove(lifeHistory.size() - 1);
 
                if (difference != 0) {
                    lifeHistory.add(newLifeString.toString());
                } else { 
                    // We are back to where we started. 
                    valueCommitted = true;
                } 
            } 
        } 
    } 
 
    /** 
     * Tells the model that new modifications to the life score should be placed 
     * on their own line. 
6
CodeRank

Related Vector remove Questions & Answers:

remove Method Overview
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged.
See Code Examples for other Java 8 Vector Methods: