RegularEnumSet.java revision 2362
0N/A * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Private implementation class for EnumSet, for "regular sized" enum types 0N/A * (i.e., those with 64 or fewer enum constants). 0N/A * @author Josh Bloch 0N/A * Bit vector representation of this set. The 2^k bit indicates the 0N/A * presence of universe[k] in this set. 0N/A * Returns an iterator over the elements contained in this set. The 0N/A * iterator traverses the elements in their <i>natural order</i> (which is 0N/A * the order in which the enum constants are declared). The returned 0N/A * Iterator is a "snapshot" iterator that will never throw {@link 0N/A * ConcurrentModificationException}; the elements are traversed as they 0N/A * existed when this call was invoked. 0N/A * @return an iterator over the elements contained in this set 0N/A * A bit vector representing the elements in the set not yet 0N/A * returned by this iterator. 0N/A * The bit representing the last element returned by this iterator 0N/A * but not removed, or zero if no such element exists. 0N/A * Returns the number of elements in this set. 0N/A * @return the number of elements in this set 0N/A * Returns <tt>true</tt> if this set contains no elements. 0N/A * @return <tt>true</tt> if this set contains no elements 0N/A * Returns <tt>true</tt> if this set contains the specified element. 0N/A * @param e element to be checked for containment in this collection 0N/A * @return <tt>true</tt> if this set contains the specified element 0N/A // Modification Operations 0N/A * Adds the specified element to this set if it is not already present. 0N/A * @param e element to be added to this set 0N/A * @return <tt>true</tt> if the set changed as a result of the call 0N/A * @throws NullPointerException if <tt>e</tt> is null 0N/A * Removes the specified element from this set if it is present. 0N/A * @param e element to be removed from this set, if present 0N/A * @return <tt>true</tt> if the set contained the specified element 0N/A * Returns <tt>true</tt> if this set contains all of the elements 0N/A * in the specified collection. 0N/A * @param c collection to be checked for containment in this set 0N/A * @return <tt>true</tt> if this set contains all of the elements 0N/A * in the specified collection 0N/A * @throws NullPointerException if the specified collection is null 0N/A * Adds all of the elements in the specified collection to this set. 0N/A * @param c collection whose elements are to be added to this set 0N/A * @return <tt>true</tt> if this set changed as a result of the call 0N/A * @throws NullPointerException if the specified collection or any 0N/A * of its elements are null 0N/A * Removes from this set all of its elements that are contained in 0N/A * the specified collection. 0N/A * @param c elements to be removed from this set 0N/A * @return <tt>true</tt> if this set changed as a result of the call 0N/A * @throws NullPointerException if the specified collection is null 0N/A * Retains only the elements in this set that are contained in the 0N/A * specified collection. 0N/A * @param c elements to be retained in this set 0N/A * @return <tt>true</tt> if this set changed as a result of the call 0N/A * @throws NullPointerException if the specified collection is null 0N/A * Removes all of the elements from this set. 0N/A * Compares the specified object with this set for equality. Returns 0N/A * <tt>true</tt> if the given object is also a set, the two sets have 0N/A * the same size, and every member of the given set is contained in 0N/A * @param e object to be compared for equality with this set 0N/A * @return <tt>true</tt> if the specified object is equal to this set