getIndex method
Implementation
int getIndex(int x, int y) {
switch (coordinatePlane) {
case CacheCoordinatePlane.normal:
return ((y % height) * width) + (x % width);
case CacheCoordinatePlane.mirrored:
return (_zigZag(y, height) * width) + _zigZag(x, width);
}
}