public class LinkedListSync<T> extends Object implements List<T>:
Thread-safe ordered list with the full List<T> API.
LinkedListSync<T> uses the optimized synchronized native list storage. Each public operation is serialized by the runtime for safe shared mutable access. For single-threaded hot paths, prefer LinkedList<T> or ArrayList<T>.
@param <T> Element type. @since 1.0
| Modifier and Type | Member | Description |
|---|---|---|
| public override readonly native property | sizesize as ULong |
Number of elements in the list. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | LinkedListSync | Creates an empty synchronized list. |
| public | LinkedListSyncLinkedListSync(collection as Collection<T>): |
Creates a synchronized list from a collection. |
| public | LinkedListSyncLinkedListSync(list as IList<T>): |
Creates a synchronized list from a read-only list. |
| public | LinkedListSyncLinkedListSync(source as Set<T>): |
Creates a synchronized list from a set. |
| public | LinkedListSyncLinkedListSync(tuple as Tuple): |
Creates a synchronized list from a tuple. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native | addadd(item as T) as Void |
Adds an element at the end. |
| public native | clearclear() as Void |
Removes all elements. |
| public native | countcount(item as T) as ULong |
Counts occurrences of the given element in the list. |
| public native | join | Joins elements into a string using the separator. |
| public native | removeremove(item as T) as Boolean |
Removes the first matching element. |
| public native | sortsort() as Void |
Sorts the list in ascending order. |
| public native | sortNewsortNew() as List<T> |
Returns a sorted copy without modifying this list. |
| public native | toStringtoString() as String |
Returns a string representation of the list. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native | operator in(item as T) as Boolean | Returns true if the list contains the given element. |
| public native | operator[](index as Int) as T | Gets the element at the given index. |