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

package it.unimi.dsi.fastutil.objects;

import it.unimi.dsi.fastutil.chars.Char2ObjectFunction;
import it.unimi.dsi.fastutil.doubles.Double2CharFunction;
import it.unimi.dsi.fastutil.doubles.Double2ReferenceFunction;
import it.unimi.dsi.fastutil.chars.Char2DoubleFunction;
import it.unimi.dsi.fastutil.floats.Float2CharFunction;
import it.unimi.dsi.fastutil.floats.Float2ReferenceFunction;
import it.unimi.dsi.fastutil.chars.Char2FloatFunction;
import it.unimi.dsi.fastutil.chars.Char2ReferenceFunction;
import it.unimi.dsi.fastutil.chars.Char2CharFunction;
import it.unimi.dsi.fastutil.longs.Long2CharFunction;
import it.unimi.dsi.fastutil.longs.Long2ReferenceFunction;
import it.unimi.dsi.fastutil.chars.Char2LongFunction;
import it.unimi.dsi.fastutil.ints.Int2CharFunction;
import it.unimi.dsi.fastutil.ints.Int2ReferenceFunction;
import it.unimi.dsi.fastutil.chars.Char2IntFunction;
import it.unimi.dsi.fastutil.shorts.Short2CharFunction;
import it.unimi.dsi.fastutil.shorts.Short2ReferenceFunction;
import it.unimi.dsi.fastutil.chars.Char2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2CharFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ReferenceFunction;
import it.unimi.dsi.fastutil.chars.Char2ByteFunction;
import java.util.function.ToIntFunction;
import it.unimi.dsi.fastutil.Function;

@FunctionalInterface
public interface Reference2CharFunction<K> extends Function<K, Character>, ToIntFunction<K>
{
    default int applyAsInt(final K operand) {
        return this.getChar(operand);
    }
    
    default char put(final K key, final char value) {
        throw new UnsupportedOperationException();
    }
    
    char getChar(final Object p0);
    
    default char getOrDefault(final Object key, final char defaultValue) {
        final char v;
        return ((v = this.getChar(key)) != this.defaultReturnValue() || this.containsKey(key)) ? v : defaultValue;
    }
    
    default char removeChar(final Object key) {
        throw new UnsupportedOperationException();
    }
    
    @Deprecated
    default Character put(final K key, final Character value) {
        final K k = key;
        final boolean containsKey = this.containsKey(k);
        final char v = this.put(k, (char)value);
        return containsKey ? Character.valueOf(v) : null;
    }
    
    @Deprecated
    default Character get(final Object key) {
        final Object k = key;
        final char v;
        return ((v = this.getChar(k)) != this.defaultReturnValue() || this.containsKey(k)) ? Character.valueOf(v) : null;
    }
    
    @Deprecated
    default Character getOrDefault(final Object key, final Character defaultValue) {
        final Object k = key;
        final char v = this.getChar(k);
        return (v != this.defaultReturnValue() || this.containsKey(k)) ? Character.valueOf(v) : defaultValue;
    }
    
    @Deprecated
    default Character remove(final Object key) {
        final Object k = key;
        return this.containsKey(k) ? Character.valueOf(this.removeChar(k)) : null;
    }
    
    default void defaultReturnValue(final char rv) {
        throw new UnsupportedOperationException();
    }
    
    default char defaultReturnValue() {
        return '\0';
    }
    
    @Deprecated
    default <T> java.util.function.Function<K, T> andThen(final java.util.function.Function<? super Character, ? extends T> after) {
        return super.andThen((java.util.function.Function<? super Object, ? extends T>)after);
    }
    
    default Reference2ByteFunction<K> andThenByte(final Char2ByteFunction after) {
        return k -> after.get(this.getChar(k));
    }
    
    default Byte2CharFunction composeByte(final Byte2ReferenceFunction<K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default Reference2ShortFunction<K> andThenShort(final Char2ShortFunction after) {
        return k -> after.get(this.getChar(k));
    }
    
    default Short2CharFunction composeShort(final Short2ReferenceFunction<K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default Reference2IntFunction<K> andThenInt(final Char2IntFunction after) {
        return k -> after.get(this.getChar(k));
    }
    
    default Int2CharFunction composeInt(final Int2ReferenceFunction<K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default Reference2LongFunction<K> andThenLong(final Char2LongFunction after) {
        return k -> after.get(this.getChar(k));
    }
    
    default Long2CharFunction composeLong(final Long2ReferenceFunction<K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default Reference2CharFunction<K> andThenChar(final Char2CharFunction after) {
        return k -> after.get(this.getChar(k));
    }
    
    default Char2CharFunction composeChar(final Char2ReferenceFunction<K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default Reference2FloatFunction<K> andThenFloat(final Char2FloatFunction after) {
        return k -> after.get(this.getChar(k));
    }
    
    default Float2CharFunction composeFloat(final Float2ReferenceFunction<K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default Reference2DoubleFunction<K> andThenDouble(final Char2DoubleFunction after) {
        return k -> after.get(this.getChar(k));
    }
    
    default Double2CharFunction composeDouble(final Double2ReferenceFunction<K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default <T> Reference2ObjectFunction<K, T> andThenObject(final Char2ObjectFunction<? extends T> after) {
        return (Reference2ObjectFunction<K, T>)(k -> after.get(this.getChar(k)));
    }
    
    default <T> Object2CharFunction<T> composeObject(final Object2ReferenceFunction<? super T, ? extends K> before) {
        return k -> this.getChar(before.get(k));
    }
    
    default <T> Reference2ReferenceFunction<K, T> andThenReference(final Char2ReferenceFunction<? extends T> after) {
        return (Reference2ReferenceFunction<K, T>)(k -> after.get(this.getChar(k)));
    }
    
    default <T> Reference2CharFunction<T> composeReference(final Reference2ReferenceFunction<? super T, ? extends K> before) {
        return k -> this.getChar(before.get(k));
    }
}
