equal
deleted
inserted
replaced
315 * @param rest the remaining elements the set is to contain initially |
315 * @param rest the remaining elements the set is to contain initially |
316 * @throws NullPointerException if any of the specified elements are null, |
316 * @throws NullPointerException if any of the specified elements are null, |
317 * or if <tt>rest</tt> is null |
317 * or if <tt>rest</tt> is null |
318 * @return an enum set initially containing the specified elements |
318 * @return an enum set initially containing the specified elements |
319 */ |
319 */ |
|
320 @SafeVarargs |
320 public static <E extends Enum<E>> EnumSet<E> of(E first, E... rest) { |
321 public static <E extends Enum<E>> EnumSet<E> of(E first, E... rest) { |
321 EnumSet<E> result = noneOf(first.getDeclaringClass()); |
322 EnumSet<E> result = noneOf(first.getDeclaringClass()); |
322 result.add(first); |
323 result.add(first); |
323 for (E e : rest) |
324 for (E e : rest) |
324 result.add(e); |
325 result.add(e); |