Yields nth (1-based) element of the array.

@param <E> the array element type
@param count the element cardinality
@param array the array that will be consumed
@return the nth element
4378
public static <E> E nth(long count, E[] array) {
        final Iterator<E> filtered = new FilteringIterator<E>(new ArrayIterator<E>(array), new Nth<E>(count));
        return new FirstElement<E>().apply(filtered);
    }
563485
public static <E extends Comparable<E>> void quickSort(List<E> array) {
    if (array.isEmpty()) {
      return;
    }
    recursiveQuickSort(array, 0, array.size() - 1);
  }
1327625
public static <T> T[] append(final T[] array, final T element) {

    Class<?> compType = getClassType(array, element);
    if (compType == null) {
      return null;
    }
    int newArrLength = array != null ? array.length + 1 : 1;
    @SuppressWarnings("unchecked")
    T[] newArray = (T[]) Array.newInstance(compType, newArrLength);
    if (array != null) {
      System.arraycopy(array, 0, newArray, 0, array.length);
    }
    newArray[newArray.length - 1] = element;
    return newArray;
  }
1290781
public static <E extends Comparable<E>> E searchMin(E[] array) {
        if(array.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }
        
        E min = array[0];
        
        for(int i = 1; i < array.length; i++) {
            if(array[i].compareTo(min) < 0) {
                min = array[i];
            }
        }
        
        return min;
    }
122163
public int setCount (K key, int count)
    {
        int[] val = get(key);
        if (val == null) {
            put(key, new int[] { count });
            return 0; // old value
        }
        int oldVal = val[0];
        val[0] = count;
        return oldVal;
    }
799339
def array_repeat(col, count):
    
    sc = SparkContext._active_spark_context
    return Column(sc._jvm.functions.array_repeat(_to_java_column(col), count))
1100937
@Nonnull
  public static SimpleScheduleBuilder repeatSecondlyForTotalCount (final int nCount, final int nSeconds)
  {
    ValueEnforcer.isGT0 (nCount, "Count");
    return simpleSchedule ().withIntervalInSeconds (nSeconds).withRepeatCount (nCount - 1);
  }
522891
public static <T> int count(Iterable<T> iterable) {
        int count = 0;

        if (iterable != null) {
            Iterator<T> iter = iterable.iterator();
            while (iter.hasNext()) {
                iter.next();
                count++;
            }
        }

        return count;
    }
374260
public static String[] subarrayOf
            (final String[] array,
             final int start,
             final int end)
        {
        final int subarraySize = end - start;
        final String[] subarray = new String[subarraySize];

        for (int i = 0; i < subarraySize; ++i)
            {
            subarray[i] = array[i + start];
            }

        return (subarray);
        }
1363322
@Restricted(NoExternalUse.class)
    public static void skip(@Nonnull Iterator<?> iterator, int count) {
        if (count < 0) {
            throw new IllegalArgumentException();
        }
        while (iterator.hasNext() && count-- > 0) {
            iterator.next();
        }
    }
225595
public static long countAll(int n) {
		long total = 0;
		for(int i = 1; i <= n; i++) {
			total += count(n, i);
		}
		return total;
	}
673895
public static int count(float[] array, float val) {
        int count = 0;
        for (int i=0; i<array.length; i++) {
            if (array[i] == val) {
                count++;
            }
        }
        return count;
    }
1111554
public void count(final Stat name, final int count) {
        Integer value = counters.get(name);
        value = value == null ? count : value + count;
        counters.put(name, value);
    }
375491
public int count(T x, T y, int count) {
        if (count < 1)
            throw new IllegalArgumentException("Count must be positive: " + count);
        long index = getIndex(x, y);
        int oldCount = counts.get(index);
        int newCount = count + oldCount;
        counts.put(index, newCount);
        sum += count;
        return newCount;
    }
31267
public static <E> E one(E[] array) {
        return new OneElement<E>().apply(new ArrayIterator<>(array));
    }
1359276
function getNumElementsFromNonIndexedArrays(arrays) {
    var key = Object.keys(arrays)[0];
    var array = arrays[key];
    if (isArrayBuffer(array)) {
      return array.numElements;
    } else {
      return array.data.length / array.numComponents;
    }
  }
466605
@Override
  public List<double[]> generate(int count) {
    ArrayList<double[]> result = new ArrayList<>(count);
    while(result.size() < count) {
      double[] d = new double[dim];
      for(int i = 0; i < dim; i++) {
        d[i] = axes.get(i).nextRandom();
      }
      if(trans != null) {
        d = trans.apply(d);
      }
      if(testClipping(d)) {
        if(--retries < 0) {
          throw new AbortException("Maximum retry count in generator exceeded.");
        }
        continue;
      }
      result.add(d);
    }
    return result;
  }