gets a value of a array at defined index

@param o
@param index
@return value of the variable
512908
public static Object get(Object o, int index, Object defaultValue) {
	if (index < 0) return null;
	if (o instanceof Object[]) {
	    Object[] arr = ((Object[]) o);
	    if (arr.length > index) return arr[index];
	}
	else if (o instanceof boolean[]) {
	    boolean[] arr = ((boolean[]) o);
	    if (arr.length > index) return arr[index] ? Boolean.TRUE : Boolean.FALSE;
	}
	else if (o instanceof byte[]) {
	    byte[] arr = ((byte[]) o);
	    if (arr.length > index) return new Byte(arr[index]);
	}
	else if (o instanceof char[]) {
	    char[] arr = ((char[]) o);
	    if (arr.length > index) return "" + (arr[index]);
	}
	else if (o instanceof short[]) {
	    short[] arr = ((short[]) o);
	    if (arr.length > index) return Short.valueOf(arr[index]);
	}
	else if (o instanceof int[]) {
	    int[] arr = ((int[]) o);
	    if (arr.length > index) return Integer.valueOf(arr[index]);
	}
	else if (o instanceof long[]) {
	    long[] arr = ((long[]) o);
	    if (arr.length > index) return Long.valueOf(arr[index]);
	}
	else if (o instanceof float[]) {
	    float[] arr = ((float[]) o);
	    if (arr.length > index) return new Float(arr[index]);
	}
	else if (o instanceof double[]) {
	    double[] arr = ((double[]) o);
	    if (arr.length > index) return new Double(arr[index]);
	}
	return defaultValue;
    }

    /**
     * sets a value to a array at defined index
     * 
     * @param o
     * @param index
     * @param value
     * @return value setted
     * @throws ArrayUtilException
     */
    public static Object set(Object o, int index, Object value) throws ArrayUtilException {
	if (index < 0) throw invalidIndex(index, 0);
	if (o instanceof Object[]) {
	    Object[] arr = ((Object[]) o);
	    if (arr.length > index) return arr[index] = value;
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof boolean[]) {
	    boolean[] arr = ((boolean[]) o);
	    if (arr.length > index) {
		arr[index] = Caster.toBooleanValue(value, false);
		return arr[index] ? Boolean.TRUE : Boolean.FALSE;
	    }
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof byte[]) {
	    byte[] arr = ((byte[]) o);
	    if (arr.length > index) {
		double v = Caster.toDoubleValue(value, true, Double.NaN);
		if (Decision.isValid(v)) {
		    return new Byte(arr[index] = (byte) v);
		}
	    }
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof short[]) {
	    short[] arr = ((short[]) o);
	    if (arr.length > index) {
		double v = Caster.toDoubleValue(value, true, Double.NaN);
		if (Decision.isValid(v)) {
		    return Short.valueOf(arr[index] = (short) v);
		}
	    }
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof int[]) {
	    int[] arr = ((int[]) o);
	    if (arr.length > index) {
		double v = Caster.toDoubleValue(value, true, Double.NaN);
		if (Decision.isValid(v)) {
		    return Integer.valueOf(arr[index] = (int) v);
		}
	    }
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof long[]) {
	    long[] arr = ((long[]) o);
	    if (arr.length > index) {
		double v = Caster.toDoubleValue(value, true, Double.NaN);
		if (Decision.isValid(v)) {
		    return Long.valueOf(arr[index] = (long) v);
		}
	    }
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof float[]) {
	    float[] arr = ((float[]) o);
	    if (arr.length > index) {
		double v = Caster.toDoubleValue(value, true, Double.NaN);
		if (Decision.isValid(v)) {
		    return new Float(arr[index] = (float) v);
		}
	    }
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof double[]) {
	    double[] arr = ((double[]) o);
	    if (arr.length > index) {
		double v = Caster.toDoubleValue(value, true, Double.NaN);
		if (Decision.isValid(v)) {
		    return new Double(arr[index] = v);
		}
	    }
	    throw invalidIndex(index, arr.length);
	}
	else if (o instanceof char[]) {
	    char[] arr = ((char[]) o);
	    if (arr.length > index) {
		String str = Caster.toString(value, null);
		if (str != null && str.length() > 0) {
		    char c = str.charAt(0);
		    arr[index] = c;
		    return str;
		}
	    }
	    throw invalidIndex(index, arr.length);
	}
	throw new ArrayUtilException("Object [" + Caster.toClassName(o) + "] is not a Array");
    }
1047017
public <T> T get(int index) {
        if (size() <= index) {
            return null;
        }
        return (T) args.get(index);
    }
1211714
@Override
  @SuppressWarnings("unchecked")
  public E get(int index) {
    Preconditions.checkElementIndex(index, size);
    return (E) array[index + offset];
  }
1160849
public double getValueAt( int index ) {

        int row = index / data[0].length;
        int col = index % data[0].length;

        return data[row][col];
    }
843592
public JSONArray getArray(int index) {
        Object tmp = mArray.get(index);
        return tmp == null ? null : tmp instanceof JSONArray ? (JSONArray) tmp
                : null;
    }
531816
public double get(int index) {
	// overridden for performance only.
	if (index >= size || index < 0)
		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
	return elements[index];
}
789935
public static Object getElementFromArrary(Object array, int index) {
    try {
      return Array.get(array, index);
    } catch (ArrayIndexOutOfBoundsException e) {
      return null;
    }
  }
901113
public static Object setEL(Object o, int index, Object value) {
	try {
	    return set(o, index, value);
	}
	catch (ArrayUtilException e) {
	    return null;
	}
    }
1116786
public final M get(final int index)
    {
        if ((index >= 0) && (index < size()))
        {
            return m_jso.get(index);
        }
        return null;
    }
1134052
public JsonArray getJsonArray(int index) throws JsonException {
        JsonElement el = get(index);
        if (!el.isJsonArray()) {
            throw Util.typeMismatch(index, el, "JsonArray");
        }
        return el.asJsonArray();
    }
460727
T get(long index) {
        checkRange(index);

        if (checkSubRange(index)) {
            // cannot exceed Integer.MAX_VALUE (checked by checkSubRange)
            return subList.get((int) (index - subListOffset));
        }
        return null;
    }
1226471
@Override
    public Array getArray(int index) {
        synchronized (lock) {
            final Object obj = getMValue(internalArray, index).asNative(internalArray);
            return obj instanceof Array ? (Array) obj : null;
        }
    }
244197
public LazyArray getJSONArray(int index) throws LazyException{
		LazyNode token=getValueToken(index);
		if(token.type!=LazyNode.ARRAY)throw new LazyException("Requested value is not an array",token);
		LazyArray arr= new LazyArray(token);
		arr.parent=this;
		return arr;
	}
959542
public Object get(int index) {

        if (index >= elementCount) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " >= "
                                                + elementCount);
        }

        if (index < 0) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " < 0");
        }

        return elementData[index];
    }
668299
public Object getListFieldValue(String fieldName, int index) {
		Object ret = null;
		Object val = getFieldValue(fieldName, true); // internal
		if (val instanceof List<?>) {
			List<?> list = (List<?>)val;
			Object cval = list.get(index);
			DomainObject gdo = getForRawObject(cval);
			if (gdo != null)
				ret = gdo;
			else
				ret = cval;
		} else if (val != null && val.getClass().isArray()) {
			Object aval = Array.get(val, index);
			DomainObject gdo = getForRawObject(aval);
			if (gdo != null)
				ret = gdo;
			else
				ret = aval;
		} else {
			if (!getDomainObjectType().getFieldByName(fieldName).isListOrArray())
				throw new RuntimeException("field: [" + fieldName + "] is neither list nor array");
			if (val == null)
				throw new RuntimeException("list or array field: [" + fieldName + "] is null");
		}
		return ret;
	}
573619
public int getInt( int index ) throws OdaException
	{
		Integer value = (Integer) getFieldValue(index);
        return value==null?0:value;
	}
683090
public JsonArray optJsonArray(int index) {
        JsonElement el;
        try {
            el = get(index);
        } catch (JsonException e) {
            return null;
        }
        if (!el.isJsonArray()) {
            return null;
        }
        return el.asJsonArray();
    }