Skip to content

Commit db28c51

Browse files
improve(syncmap): remove experimental api status and give the int, short and float maps the FASTEST_MIX by default
1 parent dae8bfe commit db28c51

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

collections-fastutil/src/main/java-templates/space/vectrix/sync/collections/fastutil/{{key}}2ObjectSyncMap.java.peb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import java.util.Set;
1919
import java.util.concurrent.atomic.LongAdder;
2020
import java.util.function.BiFunction;
2121
import java.util.function.{{ keyJava }}Function;
22-
import org.jetbrains.annotations.ApiStatus;
2322
import org.jspecify.annotations.NonNull;
2423
import org.jspecify.annotations.Nullable;
2524

@@ -48,7 +47,6 @@ import static java.util.Objects.requireNonNull;
4847
* @param <V> the value type
4948
* @since 1.0.0
5049
*/
51-
@ApiStatus.Experimental
5250
public class {{ key }}2ObjectSyncMap<V> extends Abstract{{ key }}2ObjectMap<V> {
5351

5452
@Serial
@@ -274,13 +272,13 @@ public class {{ key }}2ObjectSyncMap<V> extends Abstract{{ key }}2ObjectMap<V> {
274272
/* ------------------------- < Public Operations > ------------------------- */
275273

276274
/**
277-
* Initializes a new {@link {{ key }}2ObjectSyncMap} with {@link Hashing#FAST_MIX},
275+
* Initializes a new {@link {{ key }}2ObjectSyncMap} with {@link Hashing#{{ mix }}},
278276
* {@link {{ key }}2ObjectSyncMap#DEFAULT_CAPACITY} and {@link {{ key }}2ObjectSyncMap#DEFAULT_LOAD_FACTOR}.
279277
*
280278
* @since 1.0.0
281279
*/
282280
public {{ key }}2ObjectSyncMap() {
283-
this(Hashing.FAST_MIX);
281+
this(Hashing.{{ mix }});
284282
}
285283

286284
/**
@@ -295,14 +293,14 @@ public class {{ key }}2ObjectSyncMap<V> extends Abstract{{ key }}2ObjectMap<V> {
295293
}
296294

297295
/**
298-
* Initializes a new {@link {{ key }}2ObjectSyncMap} with {@link Hashing#FAST_MIX}, the
296+
* Initializes a new {@link {{ key }}2ObjectSyncMap} with {@link Hashing#{{ mix }}}, the
299297
* given initial capacity and {@link {{ key }}2ObjectSyncMap#DEFAULT_LOAD_FACTOR}.
300298
*
301299
* @param initialCapacity the initial capacity
302300
* @since 1.0.0
303301
*/
304302
public {{ key }}2ObjectSyncMap(final int initialCapacity) {
305-
this(Hashing.FAST_MIX, initialCapacity);
303+
this(Hashing.{{ mix }}, initialCapacity);
306304
}
307305

308306
/**
@@ -318,15 +316,15 @@ public class {{ key }}2ObjectSyncMap<V> extends Abstract{{ key }}2ObjectMap<V> {
318316
}
319317

320318
/**
321-
* Initializes a new {@link {{ key }}2ObjectSyncMap} with {@link Hashing#FAST_MIX}, the
319+
* Initializes a new {@link {{ key }}2ObjectSyncMap} with {@link Hashing#{{ mix }}}, the
322320
* given initial capacity and the given load factor.
323321
*
324322
* @param initialCapacity the initial capacity
325323
* @param loadFactor the load factor
326324
* @since 1.0.0
327325
*/
328326
public {{ key }}2ObjectSyncMap(final int initialCapacity, final float loadFactor) {
329-
this(Hashing.FAST_MIX, initialCapacity, loadFactor);
327+
this(Hashing.{{ mix }}, initialCapacity, loadFactor);
330328
}
331329

332330
/**

collections-fastutil/src/main/java/space/vectrix/sync/collections/fastutil/Hashing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @author Vectrix
3434
* @since 1.0.0
3535
*/
36-
@ApiStatus.Internal
36+
@ApiStatus.NonExtendable
3737
public interface Hashing {
3838
/**
3939
* The bitmask applied to ensure hash values are non-negative and fit within

collections-fastutil/src/templateData/template-variables.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,32 @@ variants:
55
keyPrimitive: double
66
keyObject: Double
77
keyJava: Double
8+
mix: FAST_MIX
89
float:
910
key: Float
1011
group: floats
1112
keyPrimitive: float
1213
keyObject: Float
1314
keyJava: Double
15+
mix: FASTEST_MIX
1416
int:
1517
key: Int
1618
group: ints
1719
keyPrimitive: int
1820
keyObject: Integer
1921
keyJava: Int
22+
mix: FASTEST_MIX
2023
short:
2124
key: Short
2225
group: shorts
2326
keyPrimitive: short
2427
keyObject: Short
2528
keyJava: Int
29+
mix: FASTEST_MIX
2630
long:
2731
key: Long
2832
group: longs
2933
keyPrimitive: long
3034
keyObject: Long
3135
keyJava: Long
36+
mix: FAST_MIX

collections/src/main/java/space/vectrix/sync/collections/Hashing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @author Vectrix
3434
* @since 1.0.0
3535
*/
36-
@ApiStatus.Internal
36+
@ApiStatus.NonExtendable
3737
public interface Hashing {
3838
/**
3939
* The bitmask applied to ensure hash values are non-negative and fit within

collections/src/main/java/space/vectrix/sync/collections/SyncMap.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.util.function.BiConsumer;
3939
import java.util.function.BiFunction;
4040
import java.util.function.Function;
41-
import org.jetbrains.annotations.ApiStatus;
4241
import org.jetbrains.annotations.UnknownNullability;
4342
import org.jspecify.annotations.NonNull;
4443
import org.jspecify.annotations.Nullable;
@@ -68,7 +67,6 @@
6867
* @param <V> the value type
6968
* @since 1.0.0
7069
*/
71-
@ApiStatus.Experimental
7270
public class SyncMap<K, V> extends AbstractMap<K, V> implements ConcurrentMap<K, V> {
7371

7472
/* ---------------------------- < Constants > ---------------------------- */

0 commit comments

Comments
 (0)