public double[] getData(int[] indexes)
    {	
	if(indexes.length > 0 && indexes.length <= data.length)
	{
	    if(indexes.length > 1)
		Arrays.sort(indexes);

	    // If the first element in the indexes array
	    // is larger than the data array length,
	    // or if the first index is less than zero,
	    // then return null
	    if(indexes[0] > data.length | indexes[0] < 0)
		return null;

	    // If the last element in the indexes array
	    // is larger than the data array length then return null.
	    if(indexes[indexes.length-1] > data.length)
		return null;
	    
	    double[] filteredData = new double[indexes.length];
	    
	    for(int i = 0; i < indexes.length; i++)
		filteredData[i] = data[indexes[i]];
	    
	    return filteredData;
	}
	else
	    return null;
    }