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

This code example shows how to use the following methods:clear
    return modified;
  } 
 
  public void clear() { 
    setDirty(); 
    underlying.clear();
  } 
 
  public boolean removeAll(final Collection<?> c) {
    setDirty(); 
    boolean modified = super.removeAll(c);
    for (Object o : c) {
      modified = modified || underlying.remove(OObjectEntitySerializer.serializeFieldValue(deserializeClass, o));
    } 
    return modified;
  } 
 
  public boolean isConverted() { 
    return converted;
  } 
7
CodeRank
This code example shows how to use the following methods:clear
    return modified;
  } 
 
  public void clear() { 
    setDirty(); 
    underlying.clear();
  } 
 
  public boolean removeAll(final Collection<?> c) {
    setDirty(); 
    boolean modified = super.removeAll(c);
    for (Object o : c) {
      modified = modified || underlying.remove(o.toString());
    } 
    return modified;
  } 
 
  public boolean isConverted() { 
    return converted;
  } 
7
CodeRank
This code example shows how to use the following methods:clear
        } 
        return res;
    } 
 
    public void clear() { 
        this.base.clear();
    } 
 
    public boolean contains(Object o) {
        return this.base.contains(o);
    } 
 
    public boolean containsAll(Collection<?> c) {
        return this.base.containsAll(c);
    } 
 
    public boolean isEmpty() { 
        return this.base.isEmpty();
    } 
 
6
CodeRank
This code example shows how to use the following methods:add, clear
    Assert.assertEquals(properties.getPartitionDataMap(uri1), map1);
    Assert.assertEquals(properties.getPartitionDataMap(uri2), map2);
    Assert.assertEquals(properties.getPartitionDataMap(uri3), map3);
 
    // test getUriBySchemeAndPartition 
    Set<URI> set = new HashSet<URI>(1);
    set.add(uri1);
    Assert.assertEquals(properties.getUriBySchemeAndPartition("http", 0), set);
    set.add(uri2);
    Assert.assertEquals(properties.getUriBySchemeAndPartition("http", 1), set);
    set.clear();
    set.add(uri3);
    Assert.assertEquals(properties.getUriBySchemeAndPartition("https", 1), set);
    Assert.assertNull(properties.getUriBySchemeAndPartition("rtp", 0));
    Assert.assertNull(properties.getUriBySchemeAndPartition("http", 2));
     
    // test unmodifiability 
    Map<URI, Map<Integer, PartitionData>> partitionDesc = properties.getPartitionDesc();
    Map<Integer, PartitionData> partitionDataMap = properties.getPartitionDataMap(uri1);
    URI testUri = URI.create("test");
8
CodeRank
This code example shows how to use the following methods:add, clear
     * Sets the files to be deleted by this task. 
     * 
     * @param target Any type of object accepted by {@link org.gradle.api.Project#files(Object...)} 
     */ 
    public void setDelete(Object target) { 
        delete.clear(); 
        this.delete.add(target); 
    } 
 
    /** 
     * Adds some files to be deleted by this task. The given targets are evaluated as per {@link org.gradle.api.Project#files(Object...)}. 
     * 
     * @param targets Any type of object accepted by {@link org.gradle.api.Project#files(Object...)} 
     */ 
    public Delete delete(Object... targets) { 
        for (Object target : targets) { 
            this.delete.add(target); 
        } 
        return this; 
    } 
6
CodeRank
This code example shows how to use the following methods:clear
    public void removeAlias(String alias){
        aliases.remove(alias);
    } 
     
    public void removeAllAliases(){ 
        aliases.clear();
    } 
    public Set<String> getAliases() {
        return aliases;
    } 
    public String getAlias() {
        Iterator<String> iter = aliases.iterator();
        if (iter.hasNext())
            return iter.next();
        else 
            return null; 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:clear
     * 
     * @return this adapter 
     */ 
    public DefaultRepositoryListAdapter clearHeaders() { 
        headers.clear();
        noSeparators.clear();
        return this;
    } 
 
    /** 
     * Register section header 
     * 
     * @param repository 
     * @param text 
     * @return this adapter 
     */ 
    public DefaultRepositoryListAdapter registerHeader(Repository repository,
            String text) {
        headers.put(repository.getId(), text);
        return this;
6
CodeRank
This code example shows how to use the following methods:addAll, clear
 
    public PatternSet copyFrom(PatternFilterable sourcePattern) {
        setIncludes(sourcePattern.getIncludes());
        setExcludes(sourcePattern.getExcludes());
        PatternSet other = (PatternSet) sourcePattern;
        includeSpecs.clear();
        includeSpecs.addAll(other.includeSpecs);
        excludeSpecs.clear();
        excludeSpecs.addAll(other.excludeSpecs);
 
        return this;
    } 
 
    public PatternSet intersect() { 
        return new IntersectionPatternSet(this);
    } 
 
    private static class IntersectionPatternSet extends PatternSet { 
 
        private final PatternSet other;
6
CodeRank
This code example shows how to use the following methods:clear, iterator, remove
    assertEquals(map, newmap);
  } 
 
  public void testEntrySet() { 
    Set<Map.Entry<String, Integer>> entries = map.entrySet();
    Map.Entry<String, Integer> entry = entries.iterator().next();
    entries.remove(entry);
    assertFalse(map.containsKey(entry.getKey()));
    assertEquals(2, map.size());
    entries.clear();
    assertEquals(0, map.size());
    assertTrue(map.isEmpty());
  } 
 
  public void testValues() { 
    Set<Integer> hmapValues = new HashSet<Integer>();
    hmapValues.addAll(hmap.values());
 
    Set<Integer> mapValues = new HashSet<Integer>();
    mapValues.addAll(map.values());
7
CodeRank
This code example shows how to use the following methods:add, clear
    public Set<Object> getFrom() {
        return files; 
    } 
 
    public void setFrom(Iterable<?> path) {
        files.clear(); 
        files.add(path);
    } 
 
    public void setFrom(Object... paths) { 
        files.clear(); 
        GUtil.addToCollection(files, Arrays.asList(paths));
    } 
 
    public ConfigurableFileCollection from(Object... paths) { 
        GUtil.addToCollection(files, Arrays.asList(paths));
        return this;
    } 
 
    public ConfigurableFileCollection builtBy(Object... tasks) { 
6
CodeRank
clear Method Overview
Removes all of the elements from this set (optional operation).
See Code Examples for other Java 8 Set Methods: