-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathUnsafeMutableLongArray.java
More file actions
55 lines (49 loc) · 1.44 KB
/
UnsafeMutableLongArray.java
File metadata and controls
55 lines (49 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package javasabr.rlib.collections.array;
/**
* An unsafe mutable view of a long array providing direct modification operations.
* Use with caution as modifications may violate array invariants.
*
* @since 10.0.0
*/
public interface UnsafeMutableLongArray extends UnsafeLongArray, MutableLongArray {
/**
* Prepares internal storage for the expected size to avoid reallocations.
*
* @param expectedSize the expected number of elements
* @return this for method chaining
* @since 10.0.0
*/
UnsafeMutableLongArray prepareForSize(int expectedSize);
/**
* Adds a value without triggering safety mechanisms.
*
* @param value the value to add
* @return this for method chaining
* @since 10.0.0
*/
UnsafeMutableLongArray unsafeAdd(long value);
/**
* Removes the element at the specified index without bounds checking.
*
* @param index the index of the element to remove
* @return the removed value
* @since 10.0.0
*/
long unsafeRemoveByIndex(int index);
/**
* Sets the value at the specified index without bounds checking.
*
* @param index the index of the value to set
* @param value the new value
* @return this for method chaining
* @since 10.0.0
*/
UnsafeMutableLongArray unsafeSet(int index, long value);
/**
* Trims the internal storage to match the current size.
*
* @return this for method chaining
* @since 10.0.0
*/
UnsafeMutableLongArray trimToSize();
}