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

package it.unimi.dsi.fastutil.shorts;

import it.unimi.dsi.fastutil.objects.Reference2ByteFunction;
import it.unimi.dsi.fastutil.objects.Reference2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ReferenceFunction;
import it.unimi.dsi.fastutil.objects.Object2ByteFunction;
import it.unimi.dsi.fastutil.objects.Object2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ObjectFunction;
import it.unimi.dsi.fastutil.doubles.Double2ByteFunction;
import it.unimi.dsi.fastutil.doubles.Double2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2DoubleFunction;
import it.unimi.dsi.fastutil.floats.Float2ByteFunction;
import it.unimi.dsi.fastutil.floats.Float2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2FloatFunction;
import it.unimi.dsi.fastutil.chars.Char2ByteFunction;
import it.unimi.dsi.fastutil.chars.Char2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2CharFunction;
import it.unimi.dsi.fastutil.longs.Long2ByteFunction;
import it.unimi.dsi.fastutil.longs.Long2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2LongFunction;
import it.unimi.dsi.fastutil.ints.Int2ByteFunction;
import it.unimi.dsi.fastutil.ints.Int2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2IntFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ByteFunction;
import it.unimi.dsi.fastutil.SafeMath;
import java.util.function.IntUnaryOperator;
import it.unimi.dsi.fastutil.Function;

@FunctionalInterface
public interface Short2ByteFunction extends Function<Short, Byte>, IntUnaryOperator
{
    @Deprecated
    default int applyAsInt(final int operand) {
        return this.get(SafeMath.safeIntToShort(operand));
    }
    
    default byte put(final short key, final byte value) {
        throw new UnsupportedOperationException();
    }
    
    byte get(final short p0);
    
    default byte getOrDefault(final short key, final byte defaultValue) {
        final byte v;
        return ((v = this.get(key)) != this.defaultReturnValue() || this.containsKey(key)) ? v : defaultValue;
    }
    
    default byte remove(final short key) {
        throw new UnsupportedOperationException();
    }
    
    @Deprecated
    default Byte put(final Short key, final Byte value) {
        final short k = key;
        final boolean containsKey = this.containsKey(k);
        final byte v = this.put(k, (byte)value);
        return containsKey ? Byte.valueOf(v) : null;
    }
    
    @Deprecated
    default Byte get(final Object key) {
        if (key == null) {
            return null;
        }
        final short k = (short)key;
        final byte v;
        return ((v = this.get(k)) != this.defaultReturnValue() || this.containsKey(k)) ? Byte.valueOf(v) : null;
    }
    
    @Deprecated
    default Byte getOrDefault(final Object key, final Byte defaultValue) {
        if (key == null) {
            return defaultValue;
        }
        final short k = (short)key;
        final byte v = this.get(k);
        return (v != this.defaultReturnValue() || this.containsKey(k)) ? Byte.valueOf(v) : defaultValue;
    }
    
    @Deprecated
    default Byte remove(final Object key) {
        if (key == null) {
            return null;
        }
        final short k = (short)key;
        return this.containsKey(k) ? Byte.valueOf(this.remove(k)) : null;
    }
    
    default boolean containsKey(final short key) {
        return true;
    }
    
    @Deprecated
    default boolean containsKey(final Object key) {
        return key != null && this.containsKey((short)key);
    }
    
    default void defaultReturnValue(final byte rv) {
        throw new UnsupportedOperationException();
    }
    
    default byte defaultReturnValue() {
        return 0;
    }
    
    @Deprecated
    default <T> java.util.function.Function<T, Byte> compose(final java.util.function.Function<? super T, ? extends Short> before) {
        return super.compose((java.util.function.Function<? super T, ?>)before);
    }
    
    @Deprecated
    default <T> java.util.function.Function<Short, T> andThen(final java.util.function.Function<? super Byte, ? extends T> after) {
        return super.andThen((java.util.function.Function<? super Object, ? extends T>)after);
    }
    
    default Short2ByteFunction andThenByte(final Byte2ByteFunction after) {
        return k -> after.get(this.get(k));
    }
    
    default Byte2ByteFunction composeByte(final Byte2ShortFunction before) {
        return k -> this.get(before.get(k));
    }
    
    default Short2ShortFunction andThenShort(final Byte2ShortFunction after) {
        return k -> after.get(this.get(k));
    }
    
    default Short2ByteFunction composeShort(final Short2ShortFunction before) {
        return k -> this.get(before.get(k));
    }
    
    default Short2IntFunction andThenInt(final Byte2IntFunction after) {
        return k -> after.get(this.get(k));
    }
    
    default Int2ByteFunction composeInt(final Int2ShortFunction before) {
        return k -> this.get(before.get(k));
    }
    
    default Short2LongFunction andThenLong(final Byte2LongFunction after) {
        return k -> after.get(this.get(k));
    }
    
    default Long2ByteFunction composeLong(final Long2ShortFunction before) {
        return k -> this.get(before.get(k));
    }
    
    default Short2CharFunction andThenChar(final Byte2CharFunction after) {
        return k -> after.get(this.get(k));
    }
    
    default Char2ByteFunction composeChar(final Char2ShortFunction before) {
        return k -> this.get(before.get(k));
    }
    
    default Short2FloatFunction andThenFloat(final Byte2FloatFunction after) {
        return k -> after.get(this.get(k));
    }
    
    default Float2ByteFunction composeFloat(final Float2ShortFunction before) {
        return k -> this.get(before.get(k));
    }
    
    default Short2DoubleFunction andThenDouble(final Byte2DoubleFunction after) {
        return k -> after.get(this.get(k));
    }
    
    default Double2ByteFunction composeDouble(final Double2ShortFunction before) {
        return k -> this.get(before.get(k));
    }
    
    default <T> Short2ObjectFunction<T> andThenObject(final Byte2ObjectFunction<? extends T> after) {
        return (Short2ObjectFunction<T>)(k -> after.get(this.get(k)));
    }
    
    default <T> Object2ByteFunction<T> composeObject(final Object2ShortFunction<? super T> before) {
        return k -> this.get(before.getShort(k));
    }
    
    default <T> Short2ReferenceFunction<T> andThenReference(final Byte2ReferenceFunction<? extends T> after) {
        return (Short2ReferenceFunction<T>)(k -> after.get(this.get(k)));
    }
    
    default <T> Reference2ByteFunction<T> composeReference(final Reference2ShortFunction<? super T> before) {
        return k -> this.get(before.getShort(k));
    }
}
