int getIndex(int x, int y) { if (coordinatePlane == CacheCoordinatePlane.normal) { return ((y % height) * width) + (x % width); } return (_zigZag(y, height) * width) + _zigZag(x, width); }