I can't think of any combination of data structures, which can achieve such performance for all methods, because you have to keep the data in all of them in sync.
Some kind of a workaround that comes to mind is to use array as the backing structure - O(1) for getting by index. Removal at index and setting at index are O(1) as well for the operation itself, the problem is the subsequent need to shift the backing array.
To somewhat fix performance of the shifting, you should not use loops, but System.arraycopy() instead. It's extremely efficient, because it won't do n
copy operations, but instead copy entire chunk of the memory at once. You can read more on the topic in Why is System.arraycopy native in Java? and Is it better to use System.arraycopy(...) than a for loop for copying arrays? This is probably what ArrayList
is doing under the hood when resizing and shifting.
Strictly speaking, this is not O(1) time complexity, but due to the efficiency of System.arraycopy()
you can get close to it, especially for large arrays.