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

This code example shows how to use the following methods:add, clear
    } 
 
    @Override 
    protected Vector<String> getDebugText() {
        if (runSinceLastTime) {
            debugText.clear();
            debugText.add((lastFrameBlurred ? "blurred" : "focused") + ": " + lastBlurDuration
                    + " ms(s)"); 
            debugText.add("moving: " + movingBits);
            debugText.add("lastDiffPercent: " + lastDiffPercent);
            runSinceLastTime = false;
        } 
        return debugText;
    } 
} 
7
CodeRank
This code example shows how to use the following methods:clear
	/** 
	 * Clears the activity stack 
	 */ 
 
	private void clearActivityStack(){ 
		activityStack.clear();
		activitiesStoredInActivityStack.clear();
	} 
 
	/** 
	 * Finishes an activity 
	 *  
	 * @param activity the activity to finish 
	 */ 
 
	private void finishActivity(Activity activity){
		if(activity != null) {
			try{ 
				activity.finish();
			}catch(Throwable e){
6
CodeRank
This code example shows how to use the following methods:clear, size, toArray
	    addEventListener(cela[i]);
    } 
 
	public void removeFrom(ObjectContainer container) {
    	if(container != null)
    		container.activate(listeners, 1);
		ClientEventListener[] list = listeners.toArray(new ClientEventListener[listeners.size()]);
		listeners.clear();
		container.delete(listeners);
		for(int i=0;i<list.length;i++)
			list[i].onRemoveEventProducer(container);
		container.delete(this);
	} 
} 
6
CodeRank
This code example shows how to use the following methods:push, clear
 
 
class JavaParseTreeBuilder extends ASTVisitor { 
 
    private char[] fBuffer;
    private Stack fStack= new Stack();
    private JavaNode fImportContainer;
    private boolean fShowCU;
 
    /* 
     * Parsing is performed on the given buffer and the resulting tree (if any) 
     * hangs below the given root. 
     */ 
    JavaParseTreeBuilder(JavaNode root, char[] buffer, boolean showCU) {
        fBuffer= buffer;
        fShowCU= showCU;
        fStack.clear();
        fStack.push(root);
    } 
 

6
CodeRank
This code example shows how to use the following methods:push, clear
charBuffer = new StringBuffer();
  } 
 
  public void parse(Node rootNode, Reader reader) throws RuntimeException {
    nodesStack.clear();
    nodesStack.push(rootNode);
    try { 
      parser.parse(new InputSource(reader), this);
      rootNode.complete();
    } 
    catch (Exception e) {
      throw new RuntimeException(e);
    } 
  } 
 
  public void startElement(String uri, String local, String qName, Attributes atts) {
    charBuffer.setLength(0);
    Node currentNode = (Node)nodesStack.peek();
    Node child;
6
CodeRank
This code example shows how to use the following methods:empty, clear
         
        public static void clear () 
        { 
            Stack s = (Stack)local.get();
 
            if ((s == null) || (s.empty()))
                return; 
 
            s.clear();
        } 
         
    } 
 
    private Subject subject = null;
    private JAASUserRealm realm = null;
    private static RoleStack runAsRoles = new RoleStack();
    private RoleCheckPolicy roleCheckPolicy = null;
    private String name = null;
    private LoginContext loginContext = null;
     
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, clear, elements
 
    Mockito.when(hrequest.getMethod()).thenReturn("POST");
    Mockito.when(hrequest.getScheme()).thenReturn("http");
    Mockito.when(hrequest.getServerName()).thenReturn("localhost");
    Mockito.when(hrequest.getServerPort()).thenReturn(8080);
    Vector<String> referers = new Vector<String>();
    referers.add("a");
    referers.add("hacker");
    Mockito.when(hrequest.getHeaders("Referer")).thenReturn(referers.elements());
    Assert.assertFalse(serverProtectionService.isMethodSafe(hrequest, hresponse));
    Mockito.verify(hresponse, Mockito.times(n400++)).sendError(Mockito.eq(400), Mockito.anyString());
 
    Mockito.when(hrequest.getMethod()).thenReturn("POST");
    Mockito.when(hrequest.getScheme()).thenReturn("http");
    Mockito.when(hrequest.getServerName()).thenReturn("localhost");
    Mockito.when(hrequest.getServerPort()).thenReturn(8080);
    referers.clear();
    Mockito.when(hrequest.getHeaders("Referer")).thenReturn(referers.elements());
    Assert.assertFalse(serverProtectionService.isMethodSafe(hrequest, hresponse));
    Mockito.verify(hresponse, Mockito.times(n400++)).sendError(Mockito.eq(400), Mockito.anyString());

6
CodeRank
This code example shows how to use the following methods:peek, push, clear, size
 
   /** 
    * @param id 
    */ 
   public void newPage(String id) {
      if (0 != _pageStack.size()){
         // if there was a previous map, then 
         // store the previous page map by id: 
         _oldPageMaps.put(current().id, current());
      } 
       
      // If we've seen this ID before, use it again: 
      IdMapTuple curTuple;
      if (_oldPageMaps.containsKey(id)){
         curTuple = _oldPageMaps.get(id);
      }else{ 
         curTuple = new IdMapTuple(id, new HashMap<String, Object>());
      } 
       
      // push the new map: 

6
CodeRank
This code example shows how to use the following methods:clear
import java.util.Vector; 
 
public abstract class BaseListAdapter extends CursorAdapter {
 
    protected LayoutInflater mInflater;
    protected Vector<Integer> mSelectedItems = new Vector<Integer>();
 
    public BaseListAdapter(Context context, Cursor cursor) {
        super(context, cursor);
        this.mInflater = LayoutInflater.from(context);
        this.mSelectedItems.clear();
    } 
 
    /** 
     * Handles click on checkbox for a list item. 
     * @param chkBox Checkbox view 
     * @param id Id assigned to the list item 
     */ 
    protected void toggleCheck(CheckBox chkBox, int id) {
        if (mSelectedItems.contains(id)) {
6
CodeRank
clear Method Overview
Removes all of the elements from this Vector.
See Code Examples for other Java 8 Vector Methods: