Java Array Element Get get(int index, final T[]... arrays)

Here you can find the source of get(int index, final T[]... arrays)

Description

get

License

Open Source License

Declaration

public static <T> T get(int index, final T[]... arrays) 

Method Source Code

//package com.java2s;
import java.util.*;

public class Main {
    public static <T> T get(int index, final T[]... arrays) {
        int shift = index;
        for (T[] tab : arrays) {
            if (shift < tab.length) {
                return tab[shift];
            } else {
                shift -= tab.length;//from www. j  ava 2s  .co m
            }
        }
        return null;
    }

    public static <T> T get(int index, final List<T>... arrays) {
        int shift = index;
        for (List<T> tab : arrays) {
            if (shift < tab.size()) {
                return tab.get(shift);
            } else {
                shift -= tab.size();
            }
        }
        return null;
    }
}

Related

  1. arrayElement(T[] array, int index)
  2. get(Object[] array, int index)
  3. get(T[] array, int index)
  4. get(T[] array, int index)
  5. get(T[] array, int index)