/** * MatrixCell.java * * Copyright 2000 Eliad Technologies, Inc. All Rights Reserved. * * This software is the proprietary information of Eliad Technologies, Inc. */ package MultiDimTable; import com.eliad.model.ExtentCell; final public class MatrixCell implements MatrixCellModel { private int anchorRow_, anchorColumn_, rowCount_, columnCount_; private ExtentCell cacheExtentCell_ = null; private Object value_; public MatrixCell(Object value, int anchorRow, int anchorColumn, int rowCount, int columnCount) { value_ = value; setSpannedArea(anchorRow, anchorColumn, rowCount, columnCount); } public boolean isSpanEmpty() { return (rowCount_ == 1 && columnCount_ == 1); } public ExtentCell getExtentCell() { if (isSpanEmpty()) return null; return cacheExtentCell_; } public void setSpannedArea(int anchorRow, int anchorColumn, int rowCount, int columnCount) { anchorRow_ = anchorRow; anchorColumn_ = anchorColumn; rowCount_ = rowCount; columnCount_ = columnCount; makeExtentCell(); } private void makeExtentCell() { cacheExtentCell_ = new ExtentCell() { public int getRow() { return anchorRow_; } public int getRowCount() { return rowCount_; } public int getColumn() { return anchorColumn_; } public int getColumnCount() { return columnCount_; } public Object getIdentifier() { return null; } }; } public Object getValue() { return value_; } public void setValue(Object obj) { value_ = obj; } }