Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* This file is part of "lunisolar-magma".
*
* (C) Copyright 2014-2019 Lunisolar (http://lunisolar.eu/).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.lunisolar.magma.func;
import eu.lunisolar.magma.basics.meta.aType;
import eu.lunisolar.magma.basics.meta.aType.*;
import eu.lunisolar.magma.basics.meta.functional.IndexedRead;
import eu.lunisolar.magma.basics.meta.functional.IndexedWrite;
import eu.lunisolar.magma.basics.meta.functional.type.OiFunction;
import eu.lunisolar.magma.basics.meta.functional.type.TieConsumer;
import eu.lunisolar.magma.basics.meta.functional.type.TieFunction;
import eu.lunisolar.magma.func.function.to.LToIntFunction;
import java.lang.reflect.*;
import java.util.*;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieBoolConsumer.tieBoolCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieByteConsumer.tieByteCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieCharConsumer.tieCharCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieConsumer.tieCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieDblConsumer.tieDblCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieFltConsumer.tieFltCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieIntConsumer.tieIntCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieLongConsumer.tieLongCons;
import static eu.lunisolar.magma.func.consumer.primitives.obj.LTieSrtConsumer.tieSrtCons;
import static eu.lunisolar.magma.func.function.from.LOiFunction.oiFunc;
import static eu.lunisolar.magma.func.function.to.LOiToByteFunction.oiToByteFunc;
import static eu.lunisolar.magma.func.function.to.LOiToCharFunction.oiToCharFunc;
import static eu.lunisolar.magma.func.function.to.LOiToDblFunction.oiToDblFunc;
import static eu.lunisolar.magma.func.function.to.LOiToFltFunction.oiToFltFunc;
import static eu.lunisolar.magma.func.function.to.LOiToIntFunction.oiToIntFunc;
import static eu.lunisolar.magma.func.function.to.LOiToLongFunction.oiToLongFunc;
import static eu.lunisolar.magma.func.function.to.LOiToSrtFunction.oiToSrtFunc;
import static eu.lunisolar.magma.func.predicate.LObjIntPredicate.objIntPred;
/**
* Aggregates access functions (with index) to a specific container (e.g. array, list) of specific type (e.g. int[])
* Such access do not protect against concurrent modification.
*/
public interface IA extends IndexedRead, IndexedWrite {
public static class The implements IA {
private static final IA> LIST = iA(List::size, oiFunc(List::get), tieCons(List::set));
private static final IA INT_ARRAY = iA(IA::length, oiToIntFunc(IA::getInt), tieIntCons(IA::setInt));
private static final IA LONG_ARRAY = iA(IA::length, oiToLongFunc(IA::getLong), tieLongCons(IA::setLong));
private static final IA DOUBLE_ARRAY = iA(IA::length, oiToDblFunc(IA::getDouble), tieDblCons(IA::setDouble));
private static final IA BYTE_ARRAY = iA(IA::length, oiToByteFunc(IA::getByte), tieByteCons(IA::setByte));
private static final IA SHORT_ARRAY = iA(IA::length, oiToSrtFunc(IA::getShort), tieSrtCons(IA::setShort));
private static final IA CHAR_ARRAY = iA(IA::length, oiToCharFunc(IA::getChar), tieCharCons(IA::setChar));
private static final IA FLOAT_ARRAY = iA(IA::length, oiToFltFunc(IA::getFloat), tieFltCons(IA::setFloat));
private static final IA BOOL_ARRAY = iA(IA::length, objIntPred(IA::getBoolean), tieBoolCons(IA::setBoolean));
private static final IA