Accessors

Accessor methods are powerful tools for extracting information or creating modified versions of a quadrille instance. These methods are strictly non-mutative, ensuring the original quadrille remains unchanged while offering detailed insights or generating derivative instances.

Queries

Query methods provide computations and insights into the quadrille’s structure. These include operations such as search(pattern, strict) for finding cells matching specific patterns, magnitude(row) to calculate the number of non-empty cells in a row, and screenRow(pixelY, y, cellLength) or screenCol(pixelX, x, cellLength) for mapping pixel positions to grid indices.

Cell Contents

Cell content accessors focus on retrieving information about the value and type of individual cells. You can use read(row, col) to access a cell’s content, or methods like isValid(row, col), isEmpty(row, col), isFilled(row, col), isString(row, col), isNumber(row, col), isColor(row, col), isImage(row, col), isArray(row, col), isFunction(row, col), and isObject(row, col) to determine the type of data in a specific cell.

Instance Creators

Instance creator methods generate new quadrille instances derived from the original. These include clone() to create a shallow copy, row(row) to extract a specific row, and ring(row, col, dimension) to construct a circular subset of cells around a specified position.

Through these categories, accessor methods provide a comprehensive way to analyze and derive data from quadrille instances without altering their original state.