All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fernice.reflare.util.lib.kt Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package org.fernice.reflare.util

import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList

internal fun  fullyWeakReferenceHashMap(): ConcurrentReferenceHashMap {
    return ConcurrentReferenceHashMap(ConcurrentReferenceHashMap.ReferenceType.WEAK, ConcurrentReferenceHashMap.ReferenceType.WEAK)
}

internal fun  weakReferenceHashMap(): ConcurrentReferenceHashMap {
    return ConcurrentReferenceHashMap(ConcurrentReferenceHashMap.ReferenceType.WEAK, ConcurrentReferenceHashMap.ReferenceType.STRONG)
}

internal fun  weakReferenceHashMap(vararg initial: Pair): ConcurrentReferenceHashMap {
    val map = weakReferenceHashMap()
    map.putAll(mapOf(*initial))
    return map
}

internal fun  concurrentMap(): MutableMap = ConcurrentHashMap()

internal fun  concurrentList(): MutableList = CopyOnWriteArrayList()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy