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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<TA> TA[]
toArray
(TA[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
base
-
-
Constructor Details
-
TypeCastCollection
-
-
Method Details
-
add
- Specified by:
add
in interfaceCollection<T>
-
addAll
- Specified by:
addAll
in interfaceCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
-
contains
- Specified by:
contains
in interfaceCollection<T>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T>
-
iterator
-
remove
- Specified by:
remove
in interfaceCollection<T>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T>
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
-
toArray
public <TA> TA[] toArray(TA[] a) - Specified by:
toArray
in interfaceCollection<T>
-