<commit_before>package gwt.react.shared.utils;
/* The MIT License (MIT)

Copyright (c) 2016 GWT React

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */

import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsType;

/**
 * An interface to a JS like array. The implementation may be different on the client
 * and server
 *
 * @author pstockley
 *
 * TODO Add all the ES5 compatible methods
 *
 * @param <T>
 */
@JsType
public interface Array<T extends Object> {
    /**
     * Returns if an array is not emppty or null
     *
     * @param a the array
     * @return <code>true</code> if not empty
     */
    @JsOverlay
    static boolean isNotEmpty(Array a){

        return !isEmpty(a);
    }

    /**
     * Returns if an array is empty or null
     *
     * @param a the array
     * @return <code>true</code> if empty or null
     */
    @JsOverlay
    static boolean isEmpty(Array a){

        return null==a || a.length()==0;
    }

    /**
     * Return an array that is the concatenation of this array + the supplied array
     *
     * See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat">concat spec</a>
     *
     * @param a the array to concatenate
     * @return the new array
     */
    Array<T> concat(Array<T> a);

    /**
     * Return an array that is the concatenation of this array + the supplied value
     *<commit_msg>Fix compilation error<commit_after>package gwt.react.shared.utils;
/* The MIT License (MIT)

Copyright (c) 2016 GWT React

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */

import jsinterop.annotations.JsType;

/**
 * An interface to a JS like array. The implementation may be different on the client
 * and server
 *
 * @author pstockley
 *
 * TODO Add all the ES5 compatible methods
 *
 * @param <T>
 */
@JsType
public interface Array<T extends Object> {
    /**
     * Returns if an array is not emppty or null
     *
     * @param a the array
     * @return <code>true</code> if not empty
     */
    static boolean isNotEmpty(Array a){

        return !isEmpty(a);
    }

    /**
     * Returns if an array is empty or null
     *
     * @param a the array
     * @return <code>true</code> if empty or null
     */
    static boolean isEmpty(Array a){

        return null==a || a.length()==0;
    }

    /**
     * Return an array that is the concatenation of this array + the supplied array
     *
     * See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat">concat spec</a>
     *
     * @param a the array to concatenate
     * @return the new array
     */
    Array<T> concat(Array<T> a);

    /**
     * Return an array that is the concatenation of this array + the supplied value
     *
{'fraction_non_alphanumeric': 0.07560355781448538, 'fraction_numerical': 0.0025412960609911056, 'mean_word_length': 3.2587917042380523, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7134421', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1258, 'n_words': 608}