public class TSynchronizedFloatLists extends Object
| Modifier and Type | Method and Description |
|---|---|
static TFloatList |
wrap(TFloatList
Returns a synchronized (thread-safe) Trove list backed by the specified list.
|
public static TFloatListwrap(TFloatList list)
It is imperative that the user manually synchronize on the returned list when iterating over it:
TFloatList list = TSynchronizedFloatLists.wrap( new TFloatArrayList() );
...
synchronized( list ) {
TFloatIterator i = list.iterator(); // Must be in synchronized block
while ( i.hasNext() )
foo( i.next() );
}
Failure to follow this advice may result in non-deterministic behavior.
The returned list will be serializable if the specified list is serializable.
list - the list to be "wrapped" in a synchronized list.