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

package it.unimi.dsi.fastutil.objects;

import it.unimi.dsi.fastutil.longs.Long2ReferenceFunction;
import it.unimi.dsi.fastutil.doubles.Double2LongFunction;
import it.unimi.dsi.fastutil.doubles.Double2ObjectFunction;
import it.unimi.dsi.fastutil.longs.Long2DoubleFunction;
import it.unimi.dsi.fastutil.floats.Float2LongFunction;
import it.unimi.dsi.fastutil.floats.Float2ObjectFunction;
import it.unimi.dsi.fastutil.longs.Long2FloatFunction;
import it.unimi.dsi.fastutil.chars.Char2LongFunction;
import it.unimi.dsi.fastutil.chars.Char2ObjectFunction;
import it.unimi.dsi.fastutil.longs.Long2CharFunction;
import it.unimi.dsi.fastutil.longs.Long2ObjectFunction;
import it.unimi.dsi.fastutil.longs.Long2LongFunction;
import it.unimi.dsi.fastutil.ints.Int2LongFunction;
import it.unimi.dsi.fastutil.ints.Int2ObjectFunction;
import it.unimi.dsi.fastutil.longs.Long2IntFunction;
import it.unimi.dsi.fastutil.shorts.Short2LongFunction;
import it.unimi.dsi.fastutil.shorts.Short2ObjectFunction;
import it.unimi.dsi.fastutil.longs.Long2ShortFunction;
import it.unimi.dsi.fastutil.bytes.Byte2LongFunction;
import it.unimi.dsi.fastutil.bytes.Byte2ObjectFunction;
import it.unimi.dsi.fastutil.longs.Long2ByteFunction;
import java.util.function.ToLongFunction;
import it.unimi.dsi.fastutil.Function;

@FunctionalInterface
public interface Object2LongFunction<K> extends Function<K, Long>, ToLongFunction<K>
{
    default long applyAsLong(final K operand) {
        return this.getLong(operand);
    }
    
    default long put(final K key, final long value) {
        throw new UnsupportedOperationException();
    }
    
    long getLong(final Object p0);
    
    default long getOrDefault(final Object key, final long defaultValue) {
        final long v;
        return ((v = this.getLong(key)) != this.defaultReturnValue() || this.containsKey(key)) ? v : defaultValue;
    }
    
    default long removeLong(final Object key) {
        throw new UnsupportedOperationException();
    }
    
    @Deprecated
    default Long put(final K key, final Long value) {
        final K k = key;
        final boolean containsKey = this.containsKey(k);
        final long v = this.put(k, (long)value);
        return containsKey ? Long.valueOf(v) : null;
    }
    
    @Deprecated
    default Long get(final Object key) {
        final Object k = key;
        final long v;
        return ((v = this.getLong(k)) != this.defaultReturnValue() || this.containsKey(k)) ? Long.valueOf(v) : null;
    }
    
    @Deprecated
    default Long getOrDefault(final Object key, final Long defaultValue) {
        final Object k = key;
        final long v = this.getLong(k);
        return (v != this.defaultReturnValue() || this.containsKey(k)) ? Long.valueOf(v) : defaultValue;
    }
    
    @Deprecated
    default Long remove(final Object key) {
        final Object k = key;
        return this.containsKey(k) ? Long.valueOf(this.removeLong(k)) : null;
    }
    
    default void defaultReturnValue(final long rv) {
        throw new UnsupportedOperationException();
    }
    
    default long defaultReturnValue() {
        return 0L;
    }
    
    @Deprecated
    default <T> java.util.function.Function<K, T> andThen(final java.util.function.Function<? super Long, ? extends T> after) {
        return super.andThen((java.util.function.Function<? super Object, ? extends T>)after);
    }
    
    default Object2ByteFunction<K> andThenByte(final Long2ByteFunction after) {
        return k -> after.get(this.getLong(k));
    }
    
    default Byte2LongFunction composeByte(final Byte2ObjectFunction<K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default Object2ShortFunction<K> andThenShort(final Long2ShortFunction after) {
        return k -> after.get(this.getLong(k));
    }
    
    default Short2LongFunction composeShort(final Short2ObjectFunction<K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default Object2IntFunction<K> andThenInt(final Long2IntFunction after) {
        return k -> after.get(this.getLong(k));
    }
    
    default Int2LongFunction composeInt(final Int2ObjectFunction<K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default Object2LongFunction<K> andThenLong(final Long2LongFunction after) {
        return k -> after.get(this.getLong(k));
    }
    
    default Long2LongFunction composeLong(final Long2ObjectFunction<K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default Object2CharFunction<K> andThenChar(final Long2CharFunction after) {
        return k -> after.get(this.getLong(k));
    }
    
    default Char2LongFunction composeChar(final Char2ObjectFunction<K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default Object2FloatFunction<K> andThenFloat(final Long2FloatFunction after) {
        return k -> after.get(this.getLong(k));
    }
    
    default Float2LongFunction composeFloat(final Float2ObjectFunction<K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default Object2DoubleFunction<K> andThenDouble(final Long2DoubleFunction after) {
        return k -> after.get(this.getLong(k));
    }
    
    default Double2LongFunction composeDouble(final Double2ObjectFunction<K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default <T> Object2ObjectFunction<K, T> andThenObject(final Long2ObjectFunction<? extends T> after) {
        return (Object2ObjectFunction<K, T>)(k -> after.get(this.getLong(k)));
    }
    
    default <T> Object2LongFunction<T> composeObject(final Object2ObjectFunction<? super T, ? extends K> before) {
        return k -> this.getLong(before.get(k));
    }
    
    default <T> Object2ReferenceFunction<K, T> andThenReference(final Long2ReferenceFunction<? extends T> after) {
        return (Object2ReferenceFunction<K, T>)(k -> after.get(this.getLong(k)));
    }
    
    default <T> Reference2LongFunction<T> composeReference(final Reference2ObjectFunction<? super T, ? extends K> before) {
        return k -> this.getLong(before.get(k));
    }
}
