package org.eclipse.collections.impl.map.sorted.mutable;
import java.util.Comparator;
import java.util.SortedMap;
import org.eclipse.collections.impl.UnmodifiableMap;
public class UnmodifiableSortedMap<K, V> extends UnmodifiableMap<K, V> implements SortedMap<K, V>
{
private static final long serialVersionUID = 1L;
public UnmodifiableSortedMap(SortedMap<K, V> delegate)
{
super(delegate);
}
protected SortedMap<K, V> getSortedMap()
{
return (SortedMap<K, V>) this.delegate;
}
@Override
public Comparator<? super K> comparator()
{
return this.getSortedMap().comparator();
}
@Override
public SortedMap<K, V> subMap(K fromKey, K toKey)
{
return UnmodifiableTreeMap.of(this.getSortedMap().subMap(fromKey, toKey));
}
@Override
public SortedMap<K, V> headMap(K toKey)
{
return UnmodifiableTreeMap.of(this.getSortedMap().headMap(toKey));
}
@Override
public SortedMap<K, V> tailMap(K fromKey)
{
return UnmodifiableTreeMap.of(this.getSortedMap().tailMap(fromKey));
}
@Override
public K firstKey()
{
return this.getSortedMap().firstKey();
}
@Override
public K lastKey()
{
return this.getSortedMap().lastKey();
}
}