Java Collection Clear clear(Collection collection)

Here you can find the source of clear(Collection collection)

Description

clear

License

Open Source License

Declaration

public static <T> void clear(Collection<T> collection) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {

    public static <K, V> void clear(Map<K, V> map) {
        if (map != null) {
            map.clear();/*  w  ww  . j  av  a 2s  . c om*/
        }
    }

    public static <T> void clear(Collection<T> collection) {
        if (collection != null) {
            collection.clear();
        }
    }
}

Related

  1. cleanup(AnyCollection collection)
  2. clear(Collection collection)
  3. clear(Collection collection)
  4. clear(final Collection collection)
  5. clearAndAddAll(final Collection where, final Collection fromWhere)
  6. clearCollection(Collection collection)