java.lang.Object
speiger.src.collections.objects.utils.ObjectLists
A Helper class for Lists
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <T> speiger.src.collections.objects.utils.ObjectLists.EmptyList<T>empty()Returns a Immutable EmptyList instance that is automatically casted.static <T> ObjectList<T>reverse(ObjectList<T> list) Reverses the liststatic <T> ObjectList<T>shuffle(ObjectList<T> list) Shuffles the liststatic <T> ObjectList<T>shuffle(ObjectList<T> list, RandomGenerator random) Shuffles the liststatic <T> ObjectList<T>singleton(T element) Creates a Unmodifiable Singleton liststatic <T> ObjectList<T>synchronize(ObjectList<T> l) Returns a synchronized List instance based on the instance given.static <T> ObjectList<T>synchronize(ObjectList<T> l, Object mutex) Returns a synchronized List instance based on the instance given.static <T> ObjectList<T>unmodifiable(ObjectList<T> l) Returns a Immutable List instance based on the instance given.
-
Konstruktordetails
-
ObjectLists
public ObjectLists()
-
-
Methodendetails
-
empty
public static <T> speiger.src.collections.objects.utils.ObjectLists.EmptyList<T> empty()Returns a Immutable EmptyList instance that is automatically casted.- Typparameter:
T- the keyType of elements maintained by this Collection- Gibt zurück:
- an empty list
-
unmodifiable
Returns a Immutable List instance based on the instance given.- Typparameter:
T- the keyType of elements maintained by this Collection- Parameter:
l- that should be made immutable/unmodifiable- Gibt zurück:
- a unmodifiable list wrapper. If the list is implementing RandomAccess that is also transferred. If the List already a unmodifiable wrapper then it just returns itself.
-
synchronize
Returns a synchronized List instance based on the instance given.- Typparameter:
T- the keyType of elements maintained by this Collection- Parameter:
l- that should be synchronized- Gibt zurück:
- a synchronized list wrapper. If the list is implementing RandomAccess or IObjectArray that is also transferred. If the List already a synchronized wrapper then it just returns itself.
-
synchronize
Returns a synchronized List instance based on the instance given.- Typparameter:
T- the keyType of elements maintained by this Collection- Parameter:
l- that should be synchronizedmutex- is the controller of the synchronization block.- Gibt zurück:
- a synchronized list wrapper. If the list is implementing RandomAccess or IObjectArray that is also transferred. If the List already a synchronized wrapper then it just returns itself.
-
singleton
Creates a Unmodifiable Singleton list- Typparameter:
T- the keyType of elements maintained by this Collection- Parameter:
element- that should be used in the Singleton- Gibt zurück:
- a singleton list that is unmodifiable
-
reverse
Reverses the list- Typparameter:
T- the keyType of elements maintained by this Collection- Parameter:
list- that should be reversed.- Gibt zurück:
- the input list
-
shuffle
Shuffles the list- Typparameter:
T- the keyType of elements maintained by this Collection- Parameter:
list- that should be Shuffled.- Gibt zurück:
- the input list
-
shuffle
Shuffles the list- Typparameter:
T- the keyType of elements maintained by this Collection- Parameter:
list- that should be Shuffled.random- the random that should be used- Gibt zurück:
- the input list
-