protected ArrayMapEntryMemory getEntry(int index) {
        if (index < 0) {
            throw new IndexOutOfBoundsException("Index " + index + " is less than zero");
        }
        if (index >= size) {
            throw new IndexOutOfBoundsException("Index " + index + " is invalid for size " + size);
        }

        ArrayMapEntryMemory entry;
        if (index < (size / 2)) {
            // Search forwards
            entry = header.after;
            for (int currentIndex = 0; currentIndex < index; currentIndex++) {
                entry = entry.after;
            }
        } else {
            // Search backwards
            entry = header;
            for (int currentIndex = size; currentIndex > index; currentIndex--) {
                entry = entry.before;
            }
        }
        return entry;
    }
Gets the entry mapped to the key specified.
<p/>
This method exists for subclasses that may need to perform a multi-step
process accessing the entry. The public methods in this class don't use this
method to gain a small performance boost.

@param key the key
@return the entry, null if no match
jphp-runtime/src/php/runtime/memory/support/ArrayMemoryMap.java