Package uk.ac.ebi.utils.collections
Class TypeCastCollection<T>
java.lang.Object
uk.ac.ebi.utils.collections.TypeCastCollection<T>
- Type Parameters:
T- the target type for the collection.
- All Implemented Interfaces:
Iterable<T>,Collection<T>
Allows to type-cast the collection of super-type T1 into the sub-type T (i.e., T extends T1), which is not permitted
by the Java generics. The class is simply the adapter pattern wrapping the converted collection.
date: Jul 29, 2008
- Author:
- brandizi
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<TA> TA[]toArray(TA[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
base
-
-
Constructor Details
-
TypeCastCollection
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<T>
-
addAll
- Specified by:
addAllin interfaceCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>
-
contains
- Specified by:
containsin interfaceCollection<T>
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>
-
iterator
-
remove
- Specified by:
removein interfaceCollection<T>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>
-
size
public int size()- Specified by:
sizein interfaceCollection<T>
-
toArray
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
public <TA> TA[] toArray(TA[] a) - Specified by:
toArrayin interfaceCollection<T>
-