// 
// Decompiled by Procyon v0.6.0
// 

package it.unimi.dsi.fastutil.objects;

import it.unimi.dsi.fastutil.shorts.Short2ReferenceFunction;
import it.unimi.dsi.fastutil.doubles.Double2ShortFunction;
import it.unimi.dsi.fastutil.doubles.Double2ObjectFunction;
import it.unimi.dsi.fastutil.shorts.Short2DoubleFunction;
import it.unimi.dsi.fastutil.floats.Float2ShortFunction;
import it.unimi.dsi.fastutil.floats.Float2ObjectFunction;
import it.unimi.dsi.fastutil.shorts.Short2FloatFunction;
import it.unimi.dsi.fastutil.chars.Char2ShortFunction;
import it.unimi.dsi.fastutil.chars.Char2ObjectFunction;
import it.unimi.dsi.fastutil.shorts.Short2CharFunction;
import it.unimi.dsi.fastutil.longs.Long2ShortFunction;
import it.unimi.dsi.fastutil.longs.Long2ObjectFunction;
import it.unimi.dsi.fastutil.shorts.Short2LongFunction;
import it.unimi.dsi.fastutil.ints.Int2ShortFunction;
import it.unimi.dsi.fastutil.ints.Int2ObjectFunction;
import it.unimi.dsi.fastutil.shorts.Short2IntFunction;
import it.unimi.dsi.fastutil.shorts.Short2ObjectFunction;
import it.unimi.dsi.fastutil.shorts.Short2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ObjectFunction;
import it.unimi.dsi.fastutil.shorts.Short2ByteFunction;
import java.util.function.ToIntFunction;
import it.unimi.dsi.fastutil.Function;

@FunctionalInterface
public interface Object2ShortFunction<K> extends Function<K, Short>, ToIntFunction<K>
{
    default int applyAsInt(final K operand) {
        return this.getShort(operand);
    }
    
    default short put(final K key, final short value) {
        throw new UnsupportedOperationException();
    }
    
    short getShort(final Object p0);
    
    default short getOrDefault(final Object key, final short defaultValue) {
        final short v;
        return ((v = this.getShort(key)) != this.defaultReturnValue() || this.containsKey(key)) ? v : defaultValue;
    }
    
    default short removeShort(final Object key) {
        throw new UnsupportedOperationException();
    }
    
    @Deprecated
    default Short put(final K key, final Short value) {
        final K k = key;
        final boolean containsKey = this.containsKey(k);
        final short v = this.put(k, (short)value);
        return containsKey ? Short.valueOf(v) : null;
    }
    
    @Deprecated
    default Short get(final Object key) {
        final Object k = key;
        final short v;
        return ((v = this.getShort(k)) != this.defaultReturnValue() || this.containsKey(k)) ? Short.valueOf(v) : null;
    }
    
    @Deprecated
    default Short getOrDefault(final Object key, final Short defaultValue) {
        final Object k = key;
        final short v = this.getShort(k);
        return (v != this.defaultReturnValue() || this.containsKey(k)) ? Short.valueOf(v) : defaultValue;
    }
    
    @Deprecated
    default Short remove(final Object key) {
        final Object k = key;
        return this.containsKey(k) ? Short.valueOf(this.removeShort(k)) : null;
    }
    
    default void defaultReturnValue(final short rv) {
        throw new UnsupportedOperationException();
    }
    
    default short defaultReturnValue() {
        return 0;
    }
    
    @Deprecated
    default <T> java.util.function.Function<K, T> andThen(final java.util.function.Function<? super Short, ? extends T> after) {
        return super.andThen((java.util.function.Function<? super Object, ? extends T>)after);
    }
    
    default Object2ByteFunction<K> andThenByte(final Short2ByteFunction after) {
        return k -> after.get(this.getShort(k));
    }
    
    default Byte2ShortFunction composeByte(final Byte2ObjectFunction<K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default Object2ShortFunction<K> andThenShort(final Short2ShortFunction after) {
        return k -> after.get(this.getShort(k));
    }
    
    default Short2ShortFunction composeShort(final Short2ObjectFunction<K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default Object2IntFunction<K> andThenInt(final Short2IntFunction after) {
        return k -> after.get(this.getShort(k));
    }
    
    default Int2ShortFunction composeInt(final Int2ObjectFunction<K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default Object2LongFunction<K> andThenLong(final Short2LongFunction after) {
        return k -> after.get(this.getShort(k));
    }
    
    default Long2ShortFunction composeLong(final Long2ObjectFunction<K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default Object2CharFunction<K> andThenChar(final Short2CharFunction after) {
        return k -> after.get(this.getShort(k));
    }
    
    default Char2ShortFunction composeChar(final Char2ObjectFunction<K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default Object2FloatFunction<K> andThenFloat(final Short2FloatFunction after) {
        return k -> after.get(this.getShort(k));
    }
    
    default Float2ShortFunction composeFloat(final Float2ObjectFunction<K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default Object2DoubleFunction<K> andThenDouble(final Short2DoubleFunction after) {
        return k -> after.get(this.getShort(k));
    }
    
    default Double2ShortFunction composeDouble(final Double2ObjectFunction<K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default <T> Object2ObjectFunction<K, T> andThenObject(final Short2ObjectFunction<? extends T> after) {
        return (Object2ObjectFunction<K, T>)(k -> after.get(this.getShort(k)));
    }
    
    default <T> Object2ShortFunction<T> composeObject(final Object2ObjectFunction<? super T, ? extends K> before) {
        return k -> this.getShort(before.get(k));
    }
    
    default <T> Object2ReferenceFunction<K, T> andThenReference(final Short2ReferenceFunction<? extends T> after) {
        return (Object2ReferenceFunction<K, T>)(k -> after.get(this.getShort(k)));
    }
    
    default <T> Reference2ShortFunction<T> composeReference(final Reference2ObjectFunction<? super T, ? extends K> before) {
        return k -> this.getShort(before.get(k));
    }
}
