My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for

Contents

Complete wiki list

ObjectMatrix  
The ObjectMatrix data structure
Updated Aug 12, 2009 by hus...@gmail.com
[Serializable]
public class ObjectMatrix<T> : IMatrix<T>
{    
    // Methods
    public ObjectMatrix(int rows, int columns);    
    public void Accept(IVisitor<T> visitor);
    public void AddColumn();
    public void AddColumn(params T[] values);
    public void AddColumns(int columnCount);
    public void AddRow();
    public void AddRow(params T[] values);
    public void AddRows(int rowCount);    
    public void Clear();
    public bool Contains(T item);    
    public void CopyTo(T[] array, int arrayIndex);
    public void DeleteColumn(int column);
    public void DeleteRow(int row);
    public T[] GetColumn(int columnIndex);
    public IEnumerator<T> GetEnumerator();
    protected int GetOffset(int row, int column);
    public T[] GetRow(int rowIndex);
    public ObjectMatrix<T> GetSubMatrix(int rowStart, int columnStart, int rowCount, int columnCount);    
    public void InterchangeColumns(int firstColumn, int secondColumn);
    public void InterchangeRows(int firstRow, int secondRow);    
    public void Resize(int newNumberOfRows, int newNumberOfColumns);
    // ...
	
    // Properties
    public int Columns { get; }
    public int Count { get; }
    public bool IsEmpty { get; }
    public bool IsFixedSize { get; }
    public bool IsFull { get; }
    public bool IsReadOnly { get; }
    public bool IsSquare { get; }
    public T this[int row, int column] { get; set; }
    public int Rows { get; }
    // ...  
} 

The ObjectMatrix class is a simple representation of a 2-dimensional array of objects. It provides some other functionality than a standard jagged array, like resizing the matrix, getting rows and columns individually, and interchanging rows / columns.


Sign in to add a comment
Powered by Google Project Hosting