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

This code example shows how to use the following methods:clear
        mContext.unregisterReceiver(this);
        if (mPendingIntent != null) {
            mAlarmManager.cancel(mPendingIntent);
            mPendingIntent = null;
        } 
        mEventQueue.clear();
        mEventQueue = null;
    } 
 
    private boolean stopped() { 
        if (mEventQueue == null) {
            Log.w(TAG, "Timer stopped");
            return true; 
        } else { 
            return false; 
        } 
    } 
 
    private void cancelAlarm() { 
        mAlarmManager.cancel(mPendingIntent);
6
CodeRank
This code example shows how to use the following methods:toString, add, clear, contains
    final String retval = (String) this.cache.get(key);
    if (retval != null)
    { 
      return retval;
    } 
    this.lookupPath.clear();
    return internalGetString(key);
  } 
 
  /** 
   * Performs the lookup for the given key. If the key points to a link the 
   * link is resolved and that key is looked up instead. 
   * 
   * @param key the key for the string 
   * @return the string for the given key 
   */ 
  protected String internalGetString(final String key)
  { 
    if (this.lookupPath.contains(key))
    { 

6
CodeRank
This code example shows how to use the following methods:clear, contains, size
	/** 
	 * @tests java.util.TreeSet#clear() 
	 */ 
	public void test_clear() { 
		// Test for method void java.util.TreeSet.clear() 
		ts.clear();
		assertEquals("Returned non-zero size after clear", 0, ts.size());
		assertTrue("Found element in cleared set", !ts.contains(objArray[0]));
	} 
 
	/** 
	 * @tests java.util.TreeSet#clone() 
	 */ 
	public void test_clone() { 
		// Test for method java.lang.Object java.util.TreeSet.clone() 
		TreeSet s = (TreeSet) ts.clone();
		Iterator i = ts.iterator();
		while (i.hasNext())
			assertTrue("Clone failed to copy all elements", s
					.contains(i.next()));
5
CodeRank
This code example shows how to use the following methods:toString, add, clear, contains
    public synchronized String getString(final String key) {
        final String retval = (String) this.cache.get(key);
        if (retval != null) {
            return retval;
        } 
        this.lookupPath.clear();
        return internalGetString(key);
    } 
 
    /** 
     * Performs the lookup for the given key. If the key points to a link the link is 
     * resolved and that key is looked up instead. 
     * 
     * @param key the key for the string 
     * @return the string for the given key 
     */ 
    protected String internalGetString(final String key) {
        if (this.lookupPath.contains(key)) {
            throw new MissingResourceException
                ("InfiniteLoop in resource lookup", 

5
CodeRank
This code example shows how to use the following methods:clear
	 * Clears all cookies. 
	 */ 
	@Override 
	public synchronized void clear() 
	{ 
		cookies.clear();
	} 
 
	@Override 
	public synchronized String toString()
	{ 
		return cookies.toString();
	} 
 
	public String getCookie(String cookieName)
	{ 
		if (cookieName == null)
		{ 
			return null; 
		} 
4
CodeRank
This code example shows how to use the following methods:clear
        memento.putString("profiles", Util.join(getProfilesWithoutVendor(vendors), ","));
        memento.putInteger("require", required ? REQUIRE : DISALLOW);
    } 
 
    public void clear() { 
        profiles.clear();
    } 
 
    public IProfile[] getProfiles() { 
        return profiles.toArray(new IProfile[profiles.size()]);
    } 
 
    public String getFactoryId() {
        return ProfileFilterFactory.ID; 
    } 
 
 
} 
4
CodeRank
This code example shows how to use the following methods:clear
     *  File[] f1 = search.listFiles(C:/filelist/", "*.java"); 
     *  search.clear(); 
     *  File[] f2 = search.listFiles("C:/filelist/", "*.jsp");  
     */ 
    public void clear(){ 
    	set.clear();
    } 
} 
4
CodeRank
This code example shows how to use the following methods:clear
        } 
      } 
    } 
 
    public void clear() { 
      actionSet.clear();
      actionMap.clear();
      actionTypeList.clear();
    } 
 
    public void remove(ActionIF action) {
      String actionKey = action.getActionKey();
      actionSet.remove(actionKey);
      actionMap.remove(actionKey);
 
      MutableInteger count = actionTypeList.get(action.getActionType());
      if (count != null) {
        count.minus();
        if (count.getValue() == 0) {
          actionTypeList.remove(action.getActionType());
5
CodeRank
This code example shows how to use the following methods:clear
	public void removePhonesNumbers(String phoneNumber) {
		this.phonesNumbers.remove(phoneNumber);
	} 
	 
	public void clearPhonesNumbers() { 
		this.phonesNumbers.clear();
	} 
	 
	public boolean addEmailAddress(String emailAddress) {
		if ( emailAddress.matches("^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$") ) {
			this.emailsAddresses.add(emailAddress);
			return(true); 
		} 
		return(false); 
	} 
	public void removeEmailAddress(String emailAddress) {
		this.emailsAddresses.remove(emailAddress);
	} 
	 
	public String[] getPhonesNumbers() {		
4
CodeRank
This code example shows how to use the following methods:clear
	public static double duration = Double.POSITIVE_INFINITY;
	public static boolean blankLine = false; // Blank line between events?
	 
	public static void reset() 
	{ 
		queue.clear();
		now = 0.0;
		nextId = 0;
		currentId = -1;
		lastLogId = -1;
		duration = Double.POSITIVE_INFINITY;
	} 
	 
	public static void schedule (EventTarget target, double delay,
					int code, Object data)
	{ 
		queue.add (new Event (target, delay + now, code, data));
	} 
	 
	public static boolean nextEvent() 
4
CodeRank
clear Method Overview
Removes all of the elements from this set.
See Code Examples for other Java 8 TreeSet Methods: