Java List Value Add add(List> target, E value)

Here you can find the source of add(List> target, E value)

Description

add

License

Open Source License

Declaration

public static <E> void add(List<Set<E>> target, E value) 

Method Source Code


//package com.java2s;
import java.util.List;
import java.util.Set;

public class Main {
    public static <E> void add(List<Set<E>> target, E value) {
        int dbsize = target.size();
        switch (dbsize) {
        //         case 0:
        //            target.add(new HashSet<E>());
        //            target.get(0).add(value);
        //            break;
        case 1:/*from  w w  w.  j a  v  a 2  s. c  o  m*/
            target.get(0).add(value);
            break;
        default:
            throw new IllegalArgumentException();
        }
    }
}

Related

  1. add(List list, int index, T item)
  2. add(List list, int index, T item)
  3. add(List vector, int[] sparseVector)
  4. add(List list, Object[] array)
  5. add(List data, Object... values)
  6. add(List a, List b)
  7. add(List list, String value)
  8. add(List aList, T anObj)
  9. add(List aList, T anObject)

  10. HOME | Copyright © www.java2s.com 2016