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@815024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c1c3b44d08
commit
87bd27bed1
|
@ -38,16 +38,16 @@ import org.apache.commons.collections.SortedBidiMap;
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractSortedBidiMapDecorator
|
public abstract class AbstractSortedBidiMapDecorator<K, V> extends
|
||||||
extends AbstractOrderedBidiMapDecorator implements SortedBidiMap {
|
AbstractOrderedBidiMapDecorator<K, V> implements SortedBidiMap<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
|
||||||
*/
|
*/
|
||||||
public AbstractSortedBidiMapDecorator(SortedBidiMap map) {
|
public AbstractSortedBidiMapDecorator(SortedBidiMap<K, V> map) {
|
||||||
super(map);
|
super(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,29 +56,34 @@ public abstract class AbstractSortedBidiMapDecorator
|
||||||
*
|
*
|
||||||
* @return the decorated map
|
* @return the decorated map
|
||||||
*/
|
*/
|
||||||
protected SortedBidiMap getSortedBidiMap() {
|
protected SortedBidiMap<K, V> decorated() {
|
||||||
return (SortedBidiMap) map;
|
return (SortedBidiMap<K, V>) super.decorated();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
public SortedBidiMap inverseSortedBidiMap() {
|
@Override
|
||||||
return getSortedBidiMap().inverseSortedBidiMap();
|
public SortedBidiMap<V, K> inverseBidiMap() {
|
||||||
|
return decorated().inverseBidiMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Comparator comparator() {
|
public Comparator<? super K> comparator() {
|
||||||
return getSortedBidiMap().comparator();
|
return decorated().comparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedMap subMap(Object fromKey, Object toKey) {
|
public Comparator<? super V> valueComparator() {
|
||||||
return getSortedBidiMap().subMap(fromKey, toKey);
|
return decorated().valueComparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedMap headMap(Object toKey) {
|
public SortedMap<K, V> subMap(K fromKey, K toKey) {
|
||||||
return getSortedBidiMap().headMap(toKey);
|
return decorated().subMap(fromKey, toKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedMap tailMap(Object fromKey) {
|
public SortedMap<K, V> headMap(K toKey) {
|
||||||
return getSortedBidiMap().tailMap(fromKey);
|
return decorated().headMap(toKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SortedMap<K, V> tailMap(K fromKey) {
|
||||||
|
return decorated().tailMap(fromKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue