55 lines
1.0 KiB
PHP
55 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Arma\Internal;
|
|
|
|
/**
|
|
* Interface for objects whose elements can be accessed.
|
|
*
|
|
* @package Arma\Internal
|
|
*/
|
|
interface Accessible
|
|
{
|
|
/**
|
|
* Get number of rows.
|
|
*
|
|
* @return int
|
|
*/
|
|
function nRows();
|
|
|
|
/**
|
|
* Get number of columns.
|
|
*
|
|
* @return int
|
|
*/
|
|
function nCols();
|
|
|
|
/**
|
|
* Get number of elements.
|
|
*
|
|
* @return int
|
|
*/
|
|
function nElem();
|
|
|
|
/**
|
|
* If $j is not specified, access the n-th element. Otherwise, access the element stored at the i-th row
|
|
* and j-th column.
|
|
*
|
|
* @param int $i
|
|
* @param int $j[optional]
|
|
* @return mixed
|
|
*/
|
|
function &__invoke($i, $j);
|
|
|
|
/**
|
|
* If $j is not specified, access the n-th element. Otherwise, access the element stored at the i-th row
|
|
* and j-th column.
|
|
*
|
|
* Without a bounds check. Not recommended for use unless your code has been thoroughly debugged.
|
|
*
|
|
* @param int $i
|
|
* @param int $j[optional]
|
|
* @return mixed
|
|
*/
|
|
function &at($i, $j);
|
|
}
|