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
ConstructorsConstructorDescriptionStrictListImpl(E... elements) StrictListImpl(Iterable<? extends E> elements) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanbooleanvoidaddAllTo(Collection<? super E> collection) asList()Returns the adapter toListinterface for use with 3rd party code or standard Java libraries.voidclear()booleanbooleancontainsAll(Iterable<? extends E> elements) booleanget(int index) getLast()inthashCode()intintindexOfInstance(E instance, int lastKnownIndex) Searches the given instance using the == operator instead of equals().booleanisEmpty()iterator()remove(int index) booleanbooleanbooleanintsize()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:
addAllToin interfaceIterableWithSize<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIterableWithSize<E>
-
size
public int size()- Specified by:
sizein interfaceIterableWithSize<E>
-
contains
- Specified by:
containsin interfaceReadOnlyStrictCollection<E>
-
containsAll
- Specified by:
containsAllin interfaceReadOnlyStrictCollection<E>
-
add
- Specified by:
addin interfaceStrictCollection<E>
-
add
- Specified by:
addin interfaceStrictList<E>
-
addAll
- Specified by:
addAllin interfaceStrictCollection<E>
-
addAll
- Specified by:
addAllin interfaceStrictList<E>
-
remove
- Specified by:
removein interfaceStrictCollection<E>
-
remove
- Specified by:
removein interfaceStrictList<E>
-
removeAll
- Specified by:
removeAllin interfaceStrictCollection<E>
-
retainAll
- Specified by:
retainAllin interfaceStrictCollection<E>
-
clear
public void clear()- Specified by:
clearin interfaceStrictCollection<E>
-
indexOf
- Specified by:
indexOfin interfaceReadOnlyStrictList<E>- Returns:
- -1 if the element is not in the collection
-
indexOfInstance
Description copied from interface:ReadOnlyStrictListSearches the given instance using the == operator instead of equals().- Specified by:
indexOfInstancein 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:
getin interfaceReadOnlyStrictList<E>
-
getLast
- Specified by:
getLastin interfaceReadOnlyStrictList<E>
-
set
- Specified by:
setin interfaceStrictList<E>
-
iterator
-
toImmutable
- Specified by:
toImmutablein interfaceReadOnlyStrictList<E>
-
toArrayList
Description copied from interface:IterableWithSizeReturns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.- Specified by:
toArrayListin interfaceIterableWithSize<E>
-
toArray
Description copied from interface:IterableWithSizeIterating over array is faster, when checking for concurrent modification is not needed.- Specified by:
toArrayin interfaceIterableWithSize<E>- Parameters:
a- - must have exactly the same size as the collection
-
toString
-
hashCode
public int hashCode() -
equals
-
asList
Description copied from interface:ReadOnlyStrictListReturns the adapter toListinterface 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 throwUnsupportedOperationExceptionThe returned list isSerializable- Specified by:
asListin interfaceReadOnlyStrictList<E>
-