net.sf.javagimmicks.collections8.transformer.ValueTransformingNavigableMap Maven / Gradle / Ivy
package net.sf.javagimmicks.collections8.transformer;
import java.util.NavigableMap;
import java.util.NavigableSet;
import java.util.function.Function;
class ValueTransformingNavigableMap
extends ValueTransformingSortedMap
implements NavigableMap
{
ValueTransformingNavigableMap(NavigableMap map, Function valueTransformer)
{
super(map, valueTransformer);
}
public Entry ceilingEntry(K key)
{
Entry ceilingEntry = getNavigableMap().ceilingEntry(key);
return ceilingEntry == null ? null : new ValueTransformingEntry(
ceilingEntry,
getTransformerFunction());
}
public K ceilingKey(K key)
{
return getNavigableMap().ceilingKey(key);
}
public NavigableSet descendingKeySet()
{
return getNavigableMap().descendingKeySet();
}
public NavigableMap descendingMap()
{
return TransformerUtils.decorateValueBased(
getNavigableMap().descendingMap(),
getTransformerFunction());
}
public Entry firstEntry()
{
Entry firstEntry = getNavigableMap().firstEntry();
return firstEntry == null ? null : new ValueTransformingEntry(
firstEntry,
getTransformerFunction());
}
public Entry floorEntry(K key)
{
Entry floorEntry = getNavigableMap().floorEntry(key);
return floorEntry == null ? null : new ValueTransformingEntry(
floorEntry,
getTransformerFunction());
}
public K floorKey(K key)
{
return getNavigableMap().floorKey(key);
}
public NavigableMap headMap(K toKey, boolean inclusive)
{
return TransformerUtils.decorateValueBased(
getNavigableMap().headMap(toKey, inclusive),
getTransformerFunction());
}
public Entry higherEntry(K key)
{
return new ValueTransformingEntry(
getNavigableMap().higherEntry(key),
getTransformerFunction());
}
public K higherKey(K key)
{
return getNavigableMap().higherKey(key);
}
public Entry lastEntry()
{
Entry lastEntry = getNavigableMap().lastEntry();
return lastEntry == null ? null : new ValueTransformingEntry(
lastEntry,
getTransformerFunction());
}
public Entry lowerEntry(K key)
{
return new ValueTransformingEntry(
getNavigableMap().lowerEntry(key),
getTransformerFunction());
}
public K lowerKey(K key)
{
return getNavigableMap().lowerKey(key);
}
public NavigableSet navigableKeySet()
{
return getNavigableMap().navigableKeySet();
}
public Entry pollFirstEntry()
{
Entry firstEntry = getNavigableMap().pollFirstEntry();
return firstEntry == null ? null : new ValueTransformingEntry(
firstEntry,
getTransformerFunction());
}
public Entry pollLastEntry()
{
Entry lastEntry = getNavigableMap().pollLastEntry();
return lastEntry == null ? null : new ValueTransformingEntry(
lastEntry,
getTransformerFunction());
}
public NavigableMap subMap(K fromKey, boolean fromInclusive, K toKey,
boolean toInclusive)
{
return TransformerUtils.decorateValueBased(
getNavigableMap().subMap(fromKey, fromInclusive, toKey, toInclusive),
getTransformerFunction());
}
public NavigableMap tailMap(K fromKey, boolean inclusive)
{
return TransformerUtils.decorateValueBased(
getNavigableMap().tailMap(fromKey, inclusive),
getTransformerFunction());
}
protected NavigableMap getNavigableMap()
{
return (NavigableMap)_internalMap;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy