< prev index next >

src/java.base/share/classes/java/util/ImmutableCollections.java

Print this page




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.util;
  27 
  28 import java.io.IOException;
  29 import java.io.InvalidObjectException;
  30 import java.io.ObjectInputStream;
  31 import java.io.ObjectOutputStream;
  32 import java.io.ObjectStreamException;
  33 import java.io.Serializable;
  34 import java.util.function.BiFunction;
  35 import java.util.function.Function;
  36 import java.util.function.Predicate;
  37 import java.util.function.UnaryOperator;
  38 import jdk.internal.misc.SharedSecrets;
  39 import jdk.internal.misc.VM;
  40 import jdk.internal.vm.annotation.Stable;
  41 
  42 /**
  43  * Container class for immutable collections. Not part of the public API.
  44  * Mainly for namespace management and shared infrastructure.
  45  *
  46  * Serial warnings are suppressed throughout because all implementation
  47  * classes use a serial proxy and thus have no need to declare serialVersionUID.
  48  */
  49 @SuppressWarnings("serial")
  50 class ImmutableCollections {
  51     /**
  52      * A "salt" value used for randomizing iteration order. This is initialized once
  53      * and stays constant for the lifetime of the JVM. It need not be truly random, but
  54      * it needs to vary sufficiently from one run to the next so that iteration order
  55      * will vary between JVM runs.
  56      */
  57     static final int SALT;
  58     static {




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.util;
  27 
  28 import java.io.IOException;
  29 import java.io.InvalidObjectException;
  30 import java.io.ObjectInputStream;
  31 import java.io.ObjectOutputStream;
  32 import java.io.ObjectStreamException;
  33 import java.io.Serializable;
  34 import java.util.function.BiFunction;
  35 import java.util.function.Function;
  36 import java.util.function.Predicate;
  37 import java.util.function.UnaryOperator;
  38 import jdk.internal.access.SharedSecrets;
  39 import jdk.internal.misc.VM;
  40 import jdk.internal.vm.annotation.Stable;
  41 
  42 /**
  43  * Container class for immutable collections. Not part of the public API.
  44  * Mainly for namespace management and shared infrastructure.
  45  *
  46  * Serial warnings are suppressed throughout because all implementation
  47  * classes use a serial proxy and thus have no need to declare serialVersionUID.
  48  */
  49 @SuppressWarnings("serial")
  50 class ImmutableCollections {
  51     /**
  52      * A "salt" value used for randomizing iteration order. This is initialized once
  53      * and stays constant for the lifetime of the JVM. It need not be truly random, but
  54      * it needs to vary sufficiently from one run to the next so that iteration order
  55      * will vary between JVM runs.
  56      */
  57     static final int SALT;
  58     static {


< prev index next >