Implements the getAt(Range) method for primitive type arrays.

@param self  an array object
@param range the range of indices of interest
@return the returned values from the array corresponding to the range
@since 1.5.0
775597
protected static List primitiveArrayGet(Object self, Range range) {
        List answer = new ArrayList();
        for (Object next : range) {
            int idx = DefaultTypeTransformation.intUnbox(next);
            answer.add(primitiveArrayGet(self, idx));
        }
        return answer;
    }
1292451
@SuppressWarnings("unchecked")
    public static List<Character> getAt(char[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
161870
@SuppressWarnings("unchecked")
    public static List<Long> getAt(long[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
1345983
@SuppressWarnings("unchecked")
    public static List<Byte> getAt(byte[] array, Collection indices) {
        return primitiveArrayGet(array, indices);
    }
1249427
public static <T> Set<T> arrayToSet(final T[] array) {
        if (null == array) {
            return Collections.emptySet();
        }

        final Set<T> ret = new HashSet<T>();

        for (int i = 0; i < array.length; i++) {
            final T object = array[i];

            ret.add(object);
        }

        return ret;
    }
1157100
public static int[] range(int length) {
        int[] index = new int[length];
        for (int i=0; i<index.length; i++) {
            // TODO: This should maybe be a safe cast for the benefit of non-IntDouble classes.
            index[i] = (int) i;
        }
        return index;
    }
1206928
public static <K,V> V getAt(Map<K,V> self, K key) {
        return self.get(key);
    }
85139
public static int[] range(int start, int stop, int step) {
		if (start < stop) {
			step = Math.abs(step);
		} else if (start > stop) {
			step = -Math.abs(step);
		} else {// start == end
			return new int[] { start };
		}

		int size = Math.abs((stop - start) / step) + 1;
		int[] values = new int[size];
		int index = 0;
		for (int i = start; (step > 0) ? i <= stop : i >= stop; i += step) {
			values[index] = i;
			index++;
		}
		return values;
	}
362001
public static Range absRange(Range range) {
        if (range.getMinimum().doubleValue() >= 0 && range.getMaximum().doubleValue() >= 0) {
            return range;
        } else if (range.getMinimum().doubleValue() < 0 && range.getMaximum().doubleValue() < 0) {
            return range(- range.getMaximum().doubleValue(), - range.getMinimum().doubleValue());
        } else {
            return range(0, Math.max(range.getMinimum().doubleValue(), range.getMaximum().doubleValue()));
        }
    }
201317
public List<InetAddress> getEndpoint(Range<Token> range)
    {
        return (List<InetAddress>) rangeMap.get(range);
    }
438477
public static CharRanges withRanges(int... ranges) {
    if ((ranges.length & 1) != 0) { throw new IllegalArgumentException(); }
    for (int i = 1; i < ranges.length; ++i) {
      if (ranges[i] <= ranges[i - 1]) {
        throw new IllegalArgumentException(ranges[i] + " > " + ranges[i - 1]);
      }
    }
    return new CharRanges(ranges);
  }
184327
@SuppressWarnings("unchecked")
    public static List<Boolean> getAt(boolean[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
951289
@Nullable
	public static <T> T get(T[] array, int index) {
		return array != null && index >= 0 && index < array.length ? array[index] : null;
	}
369216
@SuppressWarnings("unchecked")
    public static List<Short> getAt(short[] array, Collection indices) {
        return primitiveArrayGet(array, indices);
    }
396132
public static int getRandomInteger(Range range)
    {
        Check.notNull(range);

        return getRandomInteger(range.getMin(), range.getMax());
    }
168784
public static Object getIndex(Object array, int index)
            throws UtilTargetError {
        Interpreter.debug("getIndex: ", array, ", index=", index);
        try {
            if ( array instanceof List )
                return ((List<?>) array).get(index);
            Object val = Array.get(array, index);
            return Primitive.wrap( val, Types.arrayElementType(array.getClass()) );
        } catch( IndexOutOfBoundsException e1 ) {
            int len = array instanceof List
                    ? ((List<?>) array).size()
                    : Array.getLength(array);
            throw new UtilTargetError("Index " + index
                    + " out-of-bounds for length " + len, e1);
        }
    }
723221
public boolean IsOverlapping(FloatRange range) {
        return ((isInside(range.min)) || (isInside(range.max)) ||
                (range.isInside(min)) || (range.isInside(max)));
    }