record.java

来自「JAVA EXCEL操作API」· Java 代码 · 共 86 行

JAVA
86
字号
/*
 * Created on 2004-3-22
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package com.zosatapo.xls.core;

import java.util.Vector;

/**
 * @author Administrator
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class Record
{
  private Schema schema;
  private int rowNum;
  
  private Vector cells;
  
  public  Record(Schema schema_,int rowNum_)
  {
    this(schema_,rowNum_,null);
  }
  
  public  Record(Schema schema_,int rowNum_,Vector cells_)
  {
    this.schema=schema_;
    this.rowNum=rowNum_;
    this.cells=cells_;
    
    if(this.cells==null)
    {
      cells=new Vector();
    }
  }
  
  public void addCell(Cell cell)
  {
    cells.addElement(cell);
  }
  
  public Cell getCell(int index)
  {
    return (Cell)cells.elementAt(index);
  }
  
  public int getRowNum()
  {
    return rowNum;
  }
  
  public int getCellCount()
  {
    return cells.size();
  }
  
  public Schema getSchema()
  {
    return schema;
  }
  
  public void setRowIndex(int rowIndex)
  {
    this.rowNum=rowIndex;
  }
  
  public int getRowIndex()
  {
    return this.rowNum;
  }
  
  public void clearCells()
  {
    cells.clear();
  }
  
  public String toString()
  {
    return "[Record] row="+rowNum+",cells="+cells;
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?