< prev index next > src/java.base/share/classes/jdk/internal/util/ReferencedKeyMap.java
Print this page
/*
! * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
/*
! * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
/**
* This class provides management of {@link Map maps} where it is desirable to
* remove entries automatically when the key is garbage collected. This is
* accomplished by using a backing map where the keys are either a
* {@link WeakReference} or a {@link SoftReference}.
+ * Keys must be {@linkplain Class#isIdentity() identity objects.}
* <p>
* To create a {@link ReferencedKeyMap} the user must provide a {@link Supplier}
* of the backing map and whether {@link WeakReference} or
* {@link SoftReference} is to be used.
*
< prev index next >