Class StrictListImpl<E>
java.lang.Object
com.polarion.alm.shared.api.utils.collections.StrictListImpl<E>
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
,IterableWithSize<E>
,ReadOnlyStrictCollection<E>
,ReadOnlyStrictList<E>
,StrictCollection<E>
,StrictList<E>
,Serializable
,Iterable<E>
- Since:
- 3.9.0
- See Also:
-
Constructor Summary
ConstructorDescriptionStrictListImpl
(E... elements) StrictListImpl
(Iterable<? extends E> elements) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
boolean
void
addAllTo
(Collection<? super E> collection) asList()
Returns the adapter toList
interface for use with 3rd party code or standard Java libraries.void
clear()
boolean
boolean
containsAll
(Iterable<? extends E> elements) boolean
get
(int index) getLast()
int
hashCode()
int
int
indexOfInstance
(E instance, int lastKnownIndex) Searches the given instance using the == operator instead of equals().boolean
isEmpty()
iterator()
remove
(int index) boolean
boolean
boolean
int
size()
E[]
Iterating over array is faster, when checking for concurrent modification is not needed.Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.toString()
<T> StrictListImpl<T>
toTransformed
(NotStrictTransformer<E, T> transformer) Each element from the collection will be transformed or skipped (if transformer returnsnull
)<T> StrictListImpl<T>
toTransformed
(StrictTransformer<E, T> transformer) Each element from the collection will be transformed.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StrictListImpl
public StrictListImpl() -
StrictListImpl
-
StrictListImpl
-
-
Method Details
-
addAllTo
- Specified by:
addAllTo
in interfaceIterableWithSize<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceIterableWithSize<E>
-
size
public int size()- Specified by:
size
in interfaceIterableWithSize<E>
-
contains
- Specified by:
contains
in interfaceReadOnlyStrictCollection<E>
-
containsAll
- Specified by:
containsAll
in interfaceReadOnlyStrictCollection<E>
-
add
- Specified by:
add
in interfaceStrictCollection<E>
-
add
- Specified by:
add
in interfaceStrictList<E>
-
addAll
- Specified by:
addAll
in interfaceStrictCollection<E>
-
addAll
- Specified by:
addAll
in interfaceStrictList<E>
-
remove
- Specified by:
remove
in interfaceStrictCollection<E>
-
remove
- Specified by:
remove
in interfaceStrictList<E>
-
removeAll
- Specified by:
removeAll
in interfaceStrictCollection<E>
-
retainAll
- Specified by:
retainAll
in interfaceStrictCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceStrictCollection<E>
-
indexOf
- Specified by:
indexOf
in interfaceReadOnlyStrictList<E>
- Returns:
- -1 if the element is not in the collection
-
indexOfInstance
Description copied from interface:ReadOnlyStrictList
Searches the given instance using the == operator instead of equals().- Specified by:
indexOfInstance
in interfaceReadOnlyStrictList<E>
lastKnownIndex
- - last known index for optimized search, use -1 if not know- Returns:
- -1 if the element is not in the collection
-
get
- Specified by:
get
in interfaceReadOnlyStrictList<E>
-
getLast
- Specified by:
getLast
in interfaceReadOnlyStrictList<E>
-
set
- Specified by:
set
in interfaceStrictList<E>
-
iterator
-
toImmutable
- Specified by:
toImmutable
in interfaceReadOnlyStrictList<E>
-
toArrayList
Description copied from interface:IterableWithSize
Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.- Specified by:
toArrayList
in interfaceIterableWithSize<E>
-
toArray
Description copied from interface:IterableWithSize
Iterating over array is faster, when checking for concurrent modification is not needed.- Specified by:
toArray
in interfaceIterableWithSize<E>
- Parameters:
a
- - must have exactly the same size as the collection
-
toString
-
hashCode
public int hashCode() -
equals
-
asList
Description copied from interface:ReadOnlyStrictList
Returns the adapter toList
interface for use with 3rd party code or standard Java libraries. Unlike theIterableWithSize.toArrayList()
which returns new list containing the same elements, this method returns live "view" of this list instance meaning that changes done to the returned instance are reflected also in the original list. Unless the original list is immutable, in which case all methods modifying the content throwUnsupportedOperationException
The returned list isSerializable
- Specified by:
asList
in interfaceReadOnlyStrictList<E>
-