Merging from -r468106:814127 of collections_jdk5_branch - namely where this code was generified; mostly in r738956.

Also see the following revisions:

    ------------------------------------------------------------------------
    r471180 | scolebourne | 2006-11-04 05:27:44 -0800 (Sat, 04 Nov 2006) | 1 line
    
    Abstract*Decorator - Generify and use covariant return types
    ------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@815021 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2009-09-15 05:54:14 +00:00
parent 7941b5f452
commit 8bdb561312
1 changed files with 14 additions and 14 deletions

View File

@ -37,16 +37,16 @@ import org.apache.commons.collections.map.AbstractMapDecorator;
*
* @author Stephen Colebourne
*/
public abstract class AbstractBidiMapDecorator
extends AbstractMapDecorator implements BidiMap {
public abstract class AbstractBidiMapDecorator<K, V> extends AbstractMapDecorator<K, V> implements
BidiMap<K, V> {
/**
* Constructor that wraps (not copies).
*
* @param map the map to decorate, must not be null
* @throws IllegalArgumentException if the collection is null
*/
protected AbstractBidiMapDecorator(BidiMap map) {
protected AbstractBidiMapDecorator(BidiMap<K, V> map) {
super(map);
}
@ -55,25 +55,25 @@ public abstract class AbstractBidiMapDecorator
*
* @return the decorated map
*/
protected BidiMap getBidiMap() {
return (BidiMap) map;
protected BidiMap<K, V> decorated() {
return (BidiMap<K, V>) super.decorated();
}
//-----------------------------------------------------------------------
public MapIterator mapIterator() {
return getBidiMap().mapIterator();
public MapIterator<K, V> mapIterator() {
return decorated().mapIterator();
}
public Object getKey(Object value) {
return getBidiMap().getKey(value);
public K getKey(Object value) {
return decorated().getKey(value);
}
public Object removeValue(Object value) {
return getBidiMap().removeValue(value);
public K removeValue(Object value) {
return decorated().removeValue(value);
}
public BidiMap inverseBidiMap() {
return getBidiMap().inverseBidiMap();
public BidiMap<V, K> inverseBidiMap() {
return decorated().inverseBidiMap();
}
}