@SuppressWarnings({ "rawtypes", "unchecked" })
	public void setElementAtIndex(int index, Object value) throws ReflectorException   {
		
		if(object == null) {
			logger.error("object is null: did you specify it using the 'inspect()' method?");
			throw new ReflectorException("object is null: did you specify it using the 'inspect()' method?");
		}
		
		if(object.getClass().isArray()) {
			 Array.set(object, translateArrayIndex(index, getArrayLength()), value);
		} else if (object instanceof List<?>){
			((List)object).set(index, value);
		} else {
			throw new ReflectorException("object is not an array or a list");
		}		
	}
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public void setElementAtIndex ( int index , Object value ) throws ReflectorException { if ( object == null ) { logger . error ( "object is null: did you specify it using the 'inspect()' method?" ) ; throw new ReflectorException ( "object is null: did you specify it using the 'inspect()' method?" ) ; } if ( object . getClass ( ) . isArray ( ) ) { Array . set ( object , translateArrayIndex ( index , getArrayLength ( ) ) , value ) ; } else if ( object instanceof List < ? > ) { ( ( List ) object ) . set ( index , value ) ; } else { throw new ReflectorException ( "object is not an array or a list" ) ; } }
Sets the value of the n-th element in an array or a list.

@param index
the offset of the element to be set; this value can be positive
(and the offset is calculated from the start of the array or list), or
negative, in which case the offset is calculated according to the rule
that element -1 is the last, -2 is the one before the last, etc.
@throws ReflectorException
if the object is not a list or an array.