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:
parent
7941b5f452
commit
8bdb561312
|
@ -37,16 +37,16 @@ import org.apache.commons.collections.map.AbstractMapDecorator;
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractBidiMapDecorator
|
public abstract class AbstractBidiMapDecorator<K, V> extends AbstractMapDecorator<K, V> implements
|
||||||
extends AbstractMapDecorator implements BidiMap {
|
BidiMap<K, V> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor that wraps (not copies).
|
* Constructor that wraps (not copies).
|
||||||
*
|
*
|
||||||
* @param map the map to decorate, must not be null
|
* @param map the map to decorate, must not be null
|
||||||
* @throws IllegalArgumentException if the collection is null
|
* @throws IllegalArgumentException if the collection is null
|
||||||
*/
|
*/
|
||||||
protected AbstractBidiMapDecorator(BidiMap map) {
|
protected AbstractBidiMapDecorator(BidiMap<K, V> map) {
|
||||||
super(map);
|
super(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,25 +55,25 @@ public abstract class AbstractBidiMapDecorator
|
||||||
*
|
*
|
||||||
* @return the decorated map
|
* @return the decorated map
|
||||||
*/
|
*/
|
||||||
protected BidiMap getBidiMap() {
|
protected BidiMap<K, V> decorated() {
|
||||||
return (BidiMap) map;
|
return (BidiMap<K, V>) super.decorated();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
public MapIterator mapIterator() {
|
public MapIterator<K, V> mapIterator() {
|
||||||
return getBidiMap().mapIterator();
|
return decorated().mapIterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getKey(Object value) {
|
public K getKey(Object value) {
|
||||||
return getBidiMap().getKey(value);
|
return decorated().getKey(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object removeValue(Object value) {
|
public K removeValue(Object value) {
|
||||||
return getBidiMap().removeValue(value);
|
return decorated().removeValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BidiMap inverseBidiMap() {
|
public BidiMap<V, K> inverseBidiMap() {
|
||||||
return getBidiMap().inverseBidiMap();
|
return decorated().inverseBidiMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue