当前位置: 首页>>代码示例>>Java>>正文


Java Record.getSid方法代码示例

本文整理汇总了Java中org.apache.poi.hssf.record.Record.getSid方法的典型用法代码示例。如果您正苦于以下问题:Java Record.getSid方法的具体用法?Java Record.getSid怎么用?Java Record.getSid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.poi.hssf.record.Record的用法示例。


在下文中一共展示了Record.getSid方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: process

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
public void process(Record r) {
  switch (r.getSid()) {
    case MergeCellsRecord.sid:
      mergeCellRecords.add((MergeCellsRecord) r);
      break;
    case SharedFormulaRecord.sid:
      shFrmRecords.add((SharedFormulaRecord) r);
      if (!(prevRec instanceof FormulaRecord)) {
        throw new RuntimeException("Shared formula record should follow a FormulaRecord");
      }
      FormulaRecord fr = (FormulaRecord) prevRec;
      firstCellRefs.add(new CellReference(fr.getRow(), fr.getColumn()));
      break;
    case ArrayRecord.sid:
      arrayRecords.add((ArrayRecord) r);
      break;
    case TableRecord.sid:
      tableRecords.add((TableRecord) r);
      break;
    default:
      plainRecords.add(r);
      break;
  }
  prevRec = r;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:26,代码来源:RowBlock.java

示例2: moveToStartOfSheet

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
/**
 * moves right after the BOF record of the target sheet
 *
 * @param sheetIndex index of target sheet
 */
private void moveToStartOfSheet(int sheetIndex) {
  int currentSheet = -1;
  while(currentSheet < sheetIndex) {
    final Record r = Preconditions.checkNotNull(recordStream.nextRecord(), "stream ended abruptly");
    final short sid = r.getSid();

    if (sid == BOFRecord.sid) { // start of a stream
      BOFRecord bof = (BOFRecord) r;
      if (bof.getType() != BOFRecord.TYPE_WORKSHEET) {
        continue; // ignored stream
      }

      currentSheet++;
    }
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:22,代码来源:XlsRecordProcessor.java

示例3: getValueAt

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
public Object getValueAt(int r, int c) {
  Record record = records.get(r);
  Object value = null;
  switch(c) {
  case 0:
    value = record.getClass().getSimpleName();
    break;
  case 1:
    value = record.getSid();
    break;
  case 2:
    value = record.getRecordSize();
    break;
  }
  return value;
}
 
开发者ID:hussainp,项目名称:JOffVis,代码行数:17,代码来源:RecordTableModel.java

示例4: recordFound

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
@Override
protected void recordFound(Record record) {
    switch(record.getSid()) {
        case BoundSheetRecord.sid:
            sheets.add(((BoundSheetRecord)record).getSheetname());
            break;
        case NameRecord.sid:
            NameRecord nr = (NameRecord) record;
            if(isUserDefinedName(nr)) {
                String name = nr.getNameText();
                String formula = toFormulaString(nr.getNameDefinition());
                if(formula != null) {
                    formula = formula.replaceAll(RELACE_WB_NAME, "");
                    names.put(name, formula);
                }
            }
        default:
            break;
    }
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:21,代码来源:XlsReferenceUtilReader.java

示例5: processRecord

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
/**
 * Cabe�ote de leitura do LeitorXLSCliente. Implementa��o do m�todo
 * processRecord da interface HSSFListener do POI {@link HSSFListener}.
 * <BR><BR>
 * A implementa��o de leitura de XLS do POI HSSF faz a leitura linear dos
 * dados do arquivo, acionando o m�todo processRecord a cada registro
 * encontrado. T�cnica semelhante � leitura de um XML por SAX.
 * <BR><BR>
 * @param record elemento do Arquivo excel que est� sendo lido no momento.
 */
public void processRecord(Record record) {
	this.xlsRecordAtual = record;
			
	System.out.println(record);
	if(isPermiteLerLinhaColuna()){
		atualizaControlePosicaoAtual();
		
		if (isEnviarMensagemJMS() && criadoNovoRegistro) {
			enviarMensagemJMS();
			criarNovoRegistro();
			this.criadoNovoRegistro = false;
		}
		
		if (isCriarNovoRegistro() && !criadoNovoRegistro) {
			this.criadoNovoRegistro = true;
		}
		
		if (isLerValorDoRecord()) {
			popularRegistroAtual();
		}
		
	}else{
		if(isFinalDeArquivo()){
			//envia �ltimo registro lido que sobrou no final do processamento
			enviarMensagemJMS();
		}
	}
	

	if (record.getSid()==SSTRecord.sid){
		sstrec = (SSTRecord) record;
	}
	
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:46,代码来源:LeitorXLSCliente.java

示例6: processRecord

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
/**
 * Cabe�ote de leitura do LeitorXLSCliente. Implementa��o do m�todo
 * processRecord da interface HSSFListener do POI {@link HSSFListener}.
 * <BR><BR>
 * A implementa��o de leitura de XLS do POI HSSF faz a leitura linear dos
 * dados do arquivo, acionando o m�todo processRecord a cada registro
 * encontrado. T�cnica semelhante � leitura de um XML por SAX.
 * <BR><BR>
 * @param record elemento do Arquivo excel que est� sendo lido no momento.
 */
public void processRecord(Record record) {
	this.xlsRecordAtual = record;
			
	
	if(isPermiteLerLinhaColuna()){
		atualizaControlePosicaoAtual();
		
		if (isEnviarMensagemJMS() && criadoNovoRegistro) {
			enviarMensagemJMS();
			criarNovoRegistro();
			this.leuPrimeiraLinha = true;
			this.criadoNovoRegistro = false;
		}
		
		/*
		if (isCriarNovoRegistro() && !criadoNovoRegistro) {
			this.criadoNovoRegistro = true;
		}
		
		if (isLerValorDoRecord()) {
			popularRegistroAtual();
		}
		 */
		
	}		

	if (record.getSid()==SSTRecord.sid){
		sstrec = (SSTRecord) record;
	}
	
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:43,代码来源:VerificadorXLSCliente.java

示例7: processRecord

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
/**
 * Cabe�ote de leitura do LeitorXLSCliente. Implementa��o do m�todo
 * processRecord da interface HSSFListener do POI {@link HSSFListener}.
 * <BR><BR>
 * A implementa��o de leitura de XLS do POI HSSF faz a leitura linear dos
 * dados do arquivo, acionando o m�todo processRecord a cada registro
 * encontrado. T�cnica semelhante � leitura de um XML por SAX.
 * <BR><BR>
 * @param record elemento do Arquivo excel que est� sendo lido no momento.
 */
public void processRecord(Record record) {
	this.xlsRecordAtual = record;
			
	if(isPermiteLerLinhaColuna()){
		atualizaControlePosicaoAtual();
		
		if (isEnviarMensagemJMS() && criadoNovoRegistro) {
			enviarMensagemJMS();
			criarNovoRegistro();
			this.criadoNovoRegistro = false;
		}
		
		if (isCriarNovoRegistro() && !criadoNovoRegistro) {
			this.criadoNovoRegistro = true;
		}
		
		if (isLerValorDoRecord()) {
			popularRegistroAtual();
		}
		
	}else{
		if(isFinalDeArquivo()){
			//envia �ltimo registro lido que sobrou no final do processamento
			enviarMensagemJMS();
		}
	}
	

	if (record.getSid()==SSTRecord.sid){
		sstrec = (SSTRecord) record;
	}
	
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:45,代码来源:LeitorXLSCliente.java

示例8: isEmpty

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
private boolean isEmpty(Record record) {
    short sid = record.getSid();
    if(LabelSSTRecord.sid == sid) {
        String str = sstRecord.getString(((LabelSSTRecord)record).getSSTIndex()).getString();
        return str==null || str.length()==0;
    }
    return false;
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:9,代码来源:XlsTableReader.java

示例9: isObProj

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
protected static boolean isObProj(Record record) {
    return record.getSid() == OB_PROJ_SID;
}
 
开发者ID:docbleach,项目名称:DocBleach,代码行数:4,代码来源:ExcelRecordCleaner.java

示例10: getValueAt

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
public Object getValueAt(Object node, int columnIndex) {
  RecordTreeNode recordTreeNode = ((RecordTreeNode) node);
  Record record = recordTreeNode.getRecord();
  Object value = null;
  if (record != null) {
    switch (columnIndex) {
    case 0:
      value = getRecordName(record);
      break;
    case 1:
      value = record.getSid();
      break;
    case 2:
      value = record.getRecordSize();
      break;
    }
  } else {
    switch (columnIndex) {
    case 0:
      String displayName = "BIFF";
      RecordTreeNode parent = recordTreeNode.getParent();
      if (parent != null) {
        int childIndex = parent.indexOfChild(recordTreeNode);
        RecordTreeNode sibling = parent.getChildAtIndex(--childIndex);
        if (sibling != null) {
          Record siblingRecord = sibling.getRecord();
          if (siblingRecord != null) {
            displayName = getRecordName(siblingRecord);
          }
        }
      }
      value = displayName + " Records [" + recordTreeNode.getCount() + "]";
      break;
    case 1:
      value = "Container ";
      break;
    case 2:
      int size = recordTreeNode.getSize();
      value = size;
      break;
    }
  }
  return value;
}
 
开发者ID:hussainp,项目名称:JOffVis,代码行数:45,代码来源:RecordTreeTableModel.java

示例11: recordFound

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
@Override
protected void recordFound(Record record) throws Exception {
    if(tableEnded)
        return;
    
    switch(record.getSid()) {
        case BoundSheetRecord.sid:
            boundRecord((BoundSheetRecord) record);
            break;
        case BOFRecord.sid:
            bofRecord((BOFRecord)record);
            break;
        case SSTRecord.sid:
            sstRecord = (SSTRecord) record;
            break;
        case BoolErrRecord.sid:
            cellRecord((CellRecord)record);
            break;
        case FormulaRecord.sid:
            cellRecord((CellRecord)record);
            break;
        case LabelSSTRecord.sid:
            cellRecord((CellRecord)record);
            break;
        case LabelRecord.sid:
            LabelRecord lr = (LabelRecord) record;
            cellRecord(lr.getRow(), lr.getColumn(), lr);
            break;
        case StringRecord.sid:
            if(outputNextString) {
                cellRecord(prevRow, prevColumn, record);
                outputNextString = false;
            }
            break;
        case NumberRecord.sid:
            cellRecord((CellRecord)record);
            break;
        default:
            break;
    }
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:42,代码来源:XlsTableReader.java

示例12: cellRecord

import org.apache.poi.hssf.record.Record; //导入方法依赖的package包/类
private void cellRecord(int row, short column, Record record) throws Exception {
    try {
        //Not on the good sheet, before first row/column
        if(!onReferencedSheet || firstRow > row || firstColumn > column)
            return;
    
        //The cell is empty, do not read it
        boolean isEmptyCell = isEmpty(record);
        if(isEmptyCell) {
            //If first cell is empty, whole table is empty
            if(firstRow==row && firstColumn == column)
                lastColumn = (short)(firstColumn - 1);
            return;
        }

        //Calculate the last column, based on the first row
        if(firstRow == row) {
            //If we missed a cell, do not read other columns
            if((column - lastColumn) < 2)
                lastColumn = column;
        }

        //after the last column
        if(column > lastColumn)
            return;

        if(column == firstColumn)
            prevColumn = firstColumn;

        //missed a row, do not read further
        if((row - prevRow)> 1 || (column-prevColumn)>1)
            return;

        short sid = record.getSid();
        switch(sid) {
            case NumberRecord.sid:
                factory.numberFound(row, column, ((NumberRecord)record).getValue());
                break;
            case LabelSSTRecord.sid:
                if(sstRecord == null)
                    throw new IllegalArgumentException("SSTRecord is null");
                int stringId = ((LabelSSTRecord)record).getSSTIndex();
                String str = sstRecord.getString(stringId).getString();
                factory.stringFound(row, column, str);
                break;
            case LabelRecord.sid:
                factory.stringFound(row, column, ((LabelRecord)record).getValue());
                break;
            case StringRecord.sid:
                factory.stringFound(row, column, ((StringRecord)record).getString());
                break;
            case FormulaRecord.sid:
                FormulaRecord fr = (FormulaRecord) record;
                if(fr.hasCachedResultString()) {
                    outputNextString = true;
                } else {
                    factory.numberFound(row, column, fr.getValue());
                }
                break;
            case BoolErrRecord.sid:
                BoolErrRecord ber = (BoolErrRecord) record;
                if(ber.isBoolean()) {
                    factory.booleanFound(row, column, ber.getBooleanValue());
                } else {
                    factory.errorFound(row, column, getErrorMsg(ber.getErrorValue()));
                }
                break;
            default:
                break;
        }

        prevRow = row;
        prevColumn = column;
    } catch (Exception ex) {
        CellReference ref = new CellReference(sheetName, row, column, false, false);
        throw new ExcelReadException(ref, ex);
    }
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:79,代码来源:XlsTableReader.java


注:本文中的org.apache.poi.hssf.record.Record.getSid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。