Java Code Examples for org.apache.poi.hssf.record.Record#getSid()

The following examples show how to use org.apache.poi.hssf.record.Record#getSid() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RowBlock.java    From dremio-oss with Apache License 2.0 7 votes vote down vote up
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;
}
 
Example 2
Source File: HSSFCell.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * used internally -- given a cell value record, figure out its type
 */
private static CellType determineType(CellValueRecordInterface cval) {
    if (cval instanceof FormulaRecordAggregate) {
        return CellType.FORMULA;
    }
    // all others are plain BIFF records
    Record record = ( Record ) cval;
    switch (record.getSid()) {

        case NumberRecord.sid :   return CellType.NUMERIC;
        case BlankRecord.sid :    return CellType.BLANK;
        case LabelSSTRecord.sid : return CellType.STRING;
        case BoolErrRecord.sid :
            BoolErrRecord boolErrRecord = ( BoolErrRecord ) record;

            return boolErrRecord.isBoolean()
                     ? CellType.BOOLEAN
                     : CellType.ERROR;
    }
    throw new RuntimeException("Bad cell value rec (" + cval.getClass().getName() + ")");
}
 
Example 3
Source File: RecordOrderer.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
private static int findInsertPosForNewMergedRecordTable(List<RecordBase> records) {
	for (int i = records.size() - 2; i >= 0; i--) { // -2 to skip EOF record
		Object rb = records.get(i);
		if (!(rb instanceof Record)) {
			// DataValidityTable, ConditionalFormattingTable,
			// even PageSettingsBlock (which doesn't normally appear after 'View Settings')
			continue;
		}
		Record rec = (Record) rb;
		switch (rec.getSid()) {
			// 'View Settings' (4 records)
			case WindowTwoRecord.sid:
			case SCLRecord.sid:
			case PaneRecord.sid:
			case SelectionRecord.sid:

			case UnknownRecord.STANDARDWIDTH_0099:
				return i + 1;
		}
	}
	throw new RuntimeException("Did not find Window2 record");
}
 
Example 4
Source File: RecordOrderer.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isGutsPriorRecord(RecordBase rb) {
	if (rb instanceof Record) {
		Record record = (Record) rb;
		switch (record.getSid()) {
			case BOFRecord.sid:
			case IndexRecord.sid:
			// calc settings block
				case UncalcedRecord.sid:
				case CalcCountRecord.sid:
				case CalcModeRecord.sid:
				case PrecisionRecord.sid:
				case RefModeRecord.sid:
				case DeltaRecord.sid:
				case IterationRecord.sid:
				case DateWindow1904Record.sid:
				case SaveRecalcRecord.sid:
			// end calc settings
			case PrintHeadersRecord.sid:
			case PrintGridlinesRecord.sid:
			case GridsetRecord.sid:
				return true;
			// DefaultRowHeightRecord.sid is next
		}
	}
	return false;
}
 
Example 5
Source File: FormulaViewer.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Method run
 * 
 * @throws IOException if the file contained errors 
 */
public void run() throws IOException {
    NPOIFSFileSystem fs  = new NPOIFSFileSystem(new File(file), true);
    try {
        InputStream is = BiffViewer.getPOIFSInputStream(fs);
        try {
            List<Record> records = RecordFactory.createRecords(is);

            for (Record record : records) {
                if (record.getSid() == FormulaRecord.sid) {
                    if (list) {
                        listFormula((FormulaRecord) record);
                    } else {
                        parseFormulaRecord((FormulaRecord) record);
                    }
                }
            }
        } finally {
            is.close();
        }
    } finally {
        fs.close();
    }
}
 
Example 6
Source File: XlsRecordProcessor.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
/**
 * 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++;
    }
  }
}
 
Example 7
Source File: InternalWorkbook.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the first occurance of a record matching a particular sid.
 *
 * @param sid the sid
 *
 * @return the matching record or {@code null} if it wasn't found
 */
public Record findFirstRecordBySid(short sid) {
    for (Record record : records.getRecords() ) {
        if (record.getSid() == sid) {
            return record;
        }
    }
    return null;
}
 
Example 8
Source File: LinkTable.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * copied from Workbook
 */
private int findFirstRecordLocBySid(short sid) {
	int index = 0;
	for (Record record : _workbookRecordList.getRecords()) {
		if (record.getSid() == sid) {
			return index;
		}
		index ++;
	}
	return -1;
}
 
Example 9
Source File: RecordOrderer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * These records may occur between the 'Worksheet Protection Block' and DIMENSION:
 * <pre>
 * o DEFCOLWIDTH
 * oo COLINFO
 * o SORT
 * </pre>
 */
private static boolean isProtectionSubsequentRecord(Object rb) {
	if (rb instanceof ColumnInfoRecordsAggregate) {
		return true; // oo COLINFO
	}
	if (rb instanceof Record) {
		Record record = (Record) rb;
		switch (record.getSid()) {
			case DefaultColWidthRecord.sid:
			case UnknownRecord.SORT_0090:
				return true;
		}
	}
	return false;
}
 
Example 10
Source File: RecordOrderer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private static boolean isPageBreakPriorRecord(Object rb) {
	if (rb instanceof Record) {
		Record record = (Record) rb;
		switch (record.getSid()) {
			case BOFRecord.sid:
			case IndexRecord.sid:
			// calc settings block
				case UncalcedRecord.sid:
				case CalcCountRecord.sid:
				case CalcModeRecord.sid:
				case PrecisionRecord.sid:
				case RefModeRecord.sid:
				case DeltaRecord.sid:
				case IterationRecord.sid:
				case DateWindow1904Record.sid:
				case SaveRecalcRecord.sid:
			// end calc settings
			case PrintHeadersRecord.sid:
			case PrintGridlinesRecord.sid:
			case GridsetRecord.sid:
			case DefaultRowHeightRecord.sid:
			case UnknownRecord.SHEETPR_0081:
				return true;
			// next is the 'Worksheet Protection Block'
		}
	}
	return false;
}
 
Example 11
Source File: RecordOrderer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Find correct position to add new CFHeader record
 */
private static int findInsertPosForNewCondFormatTable(List<RecordBase> records) {

	for (int i = records.size() - 2; i >= 0; i--) { // -2 to skip EOF record
		Object rb = records.get(i);
		if (rb instanceof MergedCellsTable) {
			return i + 1;
		}
		if (rb instanceof DataValidityTable) {
			continue;
		}

		Record rec = (Record) rb;
		switch (rec.getSid()) {
			case WindowTwoRecord.sid:
			case SCLRecord.sid:
			case PaneRecord.sid:
			case SelectionRecord.sid:
			case UnknownRecord.STANDARDWIDTH_0099:
			// MergedCellsTable usually here
			case UnknownRecord.LABELRANGES_015F:
			case UnknownRecord.PHONETICPR_00EF:
				// ConditionalFormattingTable goes here
				return i + 1;
			// HyperlinkTable (not aggregated by POI yet)
			// DataValidityTable
		}
	}
	throw new RuntimeException("Did not find Window2 record");
}
 
Example 12
Source File: SSTRecordHandler.java    From easyexcel with Apache License 2.0 4 votes vote down vote up
@Override
public boolean couldDecode(Record record) {
	return SSTRecord.sid == record.getSid();
}
 
Example 13
Source File: UserModelEventListener.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void processRecord( Record record ) {
	switch (record.getSid()) {
	
	case BOFRecord.sid:
		BOFRecord bof = (BOFRecord) record;
		//顺序进入新的Workbook  
		if (bof.getType() == bof.TYPE_WORKBOOK) {
			logger.debug( debugger, ">>>>>>>>>>开始解析excel 文档.....");
		//顺序进入新的Worksheet,因为Event API不会把Excel文件里的所有数据结构都关联起来,
		//所以这儿一定要记录现在进入第几个sheet了。
		} else if (bof.getType() == bof.TYPE_WORKSHEET) {
			//读取新的一个Sheet页
			logger.debug( debugger, ">>>>>>>>>>开始解析sheet页面内容...");
			sheetNo++;
			currentSheetDataMap=new ArrayList<Map<String,Object>>();
		}
		break;
    //开始解析Sheet的信息,记录sheet,这儿会把所有的sheet都顺序打印出来,如果有多个sheet的话,可以顺序记入到一个List里   
	case BoundSheetRecord.sid:
		BoundSheetRecord bsr = (BoundSheetRecord) record;
		logger.debug( debugger, ">>>>>>>>>>New sheet named: " + bsr.getSheetname());
		break;
	//执行行记录事件
	case RowRecord.sid:
		RowRecord rowrec = (RowRecord) record;
		logger.debug( debugger, ">>>>>>>>>>记录开始, first column at "
				+ rowrec.getFirstCol() + " last column at "
				+ rowrec.getLastCol());
		break;
	// SSTRecords store a array of unique strings used in Excel.
	case SSTRecord.sid:
		sstrec = (SSTRecord) record;
		for (int k = 0; k < sstrec.getNumUniqueStrings(); k++) {
			logger.debug( debugger, ">>>>>>>>>>String table value " + k + " = "
					+ sstrec.getString(k));
		}
		break;
		
	//发现数字类型的cell,因为数字和日期都是用这个格式,所以下面一定要判断是不是日期格式,另外默认的数字也会被视为日期格式,所以如果是数字的话,一定要明确指定格式!!!!!!!   
	case NumberRecord.sid:
			NumberRecord nr = (NumberRecord) record;
			//HSSFDateUtil.isInternalDateFormat(nr.getXFIndex())  判断是否为时间列
			int column=nr.getColumn();
			if(column==5||column==6){
				addDataAndrChangeRow(nr.getRow(),nr.getColumn(),getTime(nr.getValue()), debugger);
			}else{
				addDataAndrChangeRow(nr.getRow(),nr.getColumn(),(int)nr.getValue(), debugger);
			}
			break;
	//发现字符串类型,这儿要取字符串的值的话,跟据其index去字符串表里读取   
	case LabelSSTRecord.sid:
		LabelSSTRecord lsr = (LabelSSTRecord)record; 
		addDataAndrChangeRow(lsr.getRow(),lsr.getColumn(), sstrec.getString(lsr.getSSTIndex()), debugger);
		logger.debug( debugger, ">>>>>>>>>>文字列:"+sstrec.getString(lsr.getSSTIndex())+", 行:"+lsr.getRow()+", 列:"+lsr.getColumn());   
		break;
    case BoolErrRecord.sid: //解析boolean错误信息
           BoolErrRecord ber = (BoolErrRecord)record;   
           if(ber.isBoolean()){   
           	addDataAndrChangeRow(ber.getRow(),ber.getColumn(), ber.getBooleanValue(), debugger);
           	logger.debug( debugger, ">>>>>>>>>>Boolean:"+ber.getBooleanValue()+", 行:"+ber.getRow()+", 列:"+ber.getColumn());   
           }   
           if(ber.isError()){   
           	logger.debug( debugger, ">>>>>>>>>>Error:"+ber.getErrorValue()+", 行:"+ber.getRow()+", 列:"+ber.getColumn());   
           }   
           break;   
        //空白记录的信息
       case BlankRecord.sid: 
           BlankRecord br = (BlankRecord)record;   
           addDataAndrChangeRow(br.getRow(),br.getColumn(), "", debugger);
           logger.debug( debugger, ">>>>>>>>>>空。 行:"+br.getRow()+", 列:"+br.getColumn());   
           break;   
       case FormulaRecord.sid: //数式   
           FormulaRecord fr = (FormulaRecord)record;  
           addDataAndrChangeRow(fr.getRow(),fr.getColumn(), fr.getValue(), debugger);
           logger.debug( debugger, ">>>>>>>>>>数字 。 行:"+fr.getRow()+", 列:"+fr.getColumn());  
           break;  
	}
}
 
Example 14
Source File: UserModelEventListener.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void processRecord( Record record ) {
	switch (record.getSid()) {
	
	case BOFRecord.sid:
		BOFRecord bof = (BOFRecord) record;
		//顺序进入新的Workbook  
		if (bof.getType() == bof.TYPE_WORKBOOK) {
			logger.debug( debugger, ">>>>>>>>>>开始解析excel 文档.....");
		//顺序进入新的Worksheet,因为Event API不会把Excel文件里的所有数据结构都关联起来,
		//所以这儿一定要记录现在进入第几个sheet了。
		} else if (bof.getType() == bof.TYPE_WORKSHEET) {
			//读取新的一个Sheet页
			logger.debug( debugger, ">>>>>>>>>>开始解析sheet页面内容...");
			sheetNo++;
			currentSheetDataMap=new ArrayList<Map<String,Object>>();
		}
		break;
    //开始解析Sheet的信息,记录sheet,这儿会把所有的sheet都顺序打印出来,如果有多个sheet的话,可以顺序记入到一个List里   
	case BoundSheetRecord.sid:
		BoundSheetRecord bsr = (BoundSheetRecord) record;
		logger.debug( debugger, ">>>>>>>>>>New sheet named: " + bsr.getSheetname());
		break;
	//执行行记录事件
	case RowRecord.sid:
		RowRecord rowrec = (RowRecord) record;
		logger.debug( debugger, ">>>>>>>>>>记录开始, first column at "
				+ rowrec.getFirstCol() + " last column at "
				+ rowrec.getLastCol());
		break;
	// SSTRecords store a array of unique strings used in Excel.
	case SSTRecord.sid:
		sstrec = (SSTRecord) record;
		for (int k = 0; k < sstrec.getNumUniqueStrings(); k++) {
			logger.debug( debugger, ">>>>>>>>>>String table value " + k + " = "
					+ sstrec.getString(k));
		}
		break;
		
	//发现数字类型的cell,因为数字和日期都是用这个格式,所以下面一定要判断是不是日期格式,另外默认的数字也会被视为日期格式,所以如果是数字的话,一定要明确指定格式!!!!!!!   
	case NumberRecord.sid:
			NumberRecord nr = (NumberRecord) record;
			//HSSFDateUtil.isInternalDateFormat(nr.getXFIndex())  判断是否为时间列
			int column=nr.getColumn();
			if(column==5||column==6){
				addDataAndrChangeRow(nr.getRow(),nr.getColumn(),getTime(nr.getValue()), debugger);
			}else{
				addDataAndrChangeRow(nr.getRow(),nr.getColumn(),(int)nr.getValue(), debugger);
			}
			break;
	//发现字符串类型,这儿要取字符串的值的话,跟据其index去字符串表里读取   
	case LabelSSTRecord.sid:
		LabelSSTRecord lsr = (LabelSSTRecord)record; 
		addDataAndrChangeRow(lsr.getRow(),lsr.getColumn(), sstrec.getString(lsr.getSSTIndex()), debugger);
		logger.debug( debugger, ">>>>>>>>>>文字列:"+sstrec.getString(lsr.getSSTIndex())+", 行:"+lsr.getRow()+", 列:"+lsr.getColumn());   
		break;
    case BoolErrRecord.sid: //解析boolean错误信息
           BoolErrRecord ber = (BoolErrRecord)record;   
           if(ber.isBoolean()){   
           	addDataAndrChangeRow(ber.getRow(),ber.getColumn(), ber.getBooleanValue(), debugger);
           	logger.debug( debugger, ">>>>>>>>>>Boolean:"+ber.getBooleanValue()+", 行:"+ber.getRow()+", 列:"+ber.getColumn());   
           }   
           if(ber.isError()){   
           	logger.debug( debugger, ">>>>>>>>>>Error:"+ber.getErrorValue()+", 行:"+ber.getRow()+", 列:"+ber.getColumn());   
           }   
           break;   
        //空白记录的信息
       case BlankRecord.sid: 
           BlankRecord br = (BlankRecord)record;   
           addDataAndrChangeRow(br.getRow(),br.getColumn(), "", debugger);
           logger.debug( debugger, ">>>>>>>>>>空。 行:"+br.getRow()+", 列:"+br.getColumn());   
           break;   
       case FormulaRecord.sid: //数式   
           FormulaRecord fr = (FormulaRecord)record;  
           addDataAndrChangeRow(fr.getRow(),fr.getColumn(), fr.getValue(), debugger);
           logger.debug( debugger, ">>>>>>>>>>数字 。 行:"+fr.getRow()+", 列:"+fr.getColumn());  
           break;  
	}
}
 
Example 15
Source File: ExcelRecordCleaner.java    From DocBleach with MIT License 4 votes vote down vote up
protected static boolean isObProj(Record record) {
  return record.getSid() == OB_PROJ_SID;
}
 
Example 16
Source File: EofRecordHandler.java    From easyexcel with Apache License 2.0 4 votes vote down vote up
@Override
public boolean couldDecode(Record record) {
	return EOFRecord.sid == record.getSid();
}
 
Example 17
Source File: StringRecordHandler.java    From easyexcel with Apache License 2.0 4 votes vote down vote up
@Override
public boolean couldDecode(Record record) {
	return LabelSSTRecord.sid == record.getSid();
}
 
Example 18
Source File: EventBasedExcelExtractor.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public void processRecord(Record record) {
    String thisText = null;
    int thisRow = -1;

    switch(record.getSid()) {
    case BoundSheetRecord.sid:
        BoundSheetRecord sr = (BoundSheetRecord)record;
        sheetNames.add(sr.getSheetname());
        break;
    case BOFRecord.sid:
        BOFRecord bof = (BOFRecord)record;
        if(bof.getType() == BOFRecord.TYPE_WORKSHEET) {
            sheetNum++;
            rowNum = -1;

            if(_includeSheetNames) {
                if(_text.length() > 0) _text.append("\n");
                _text.append(sheetNames.get(sheetNum));
            }
        }
        break;
    case SSTRecord.sid:
        sstRecord = (SSTRecord)record;
        break;

    case FormulaRecord.sid:
        FormulaRecord frec = (FormulaRecord) record;
        thisRow = frec.getRow();

        if(_formulasNotResults) {
            thisText = HSSFFormulaParser.toFormulaString((HSSFWorkbook)null, frec.getParsedExpression());
        } else {
            if(frec.hasCachedResultString()) {
                // Formula result is a string
                // This is stored in the next record
                outputNextStringValue = true;
                nextRow = frec.getRow();
            } else {
                thisText = _ft.formatNumberDateCell(frec);
            }
        }
        break;
    case StringRecord.sid:
        if(outputNextStringValue) {
            // String for formula
            StringRecord srec = (StringRecord)record;
            thisText = srec.getString();
            thisRow = nextRow;
            outputNextStringValue = false;
        }
        break;
    case LabelRecord.sid:
        LabelRecord lrec = (LabelRecord) record;
        thisRow = lrec.getRow();
        thisText = lrec.getValue();
        break;
    case LabelSSTRecord.sid:
        LabelSSTRecord lsrec = (LabelSSTRecord) record;
        thisRow = lsrec.getRow();
        if(sstRecord == null) {
            throw new IllegalStateException("No SST record found");
        }
        thisText = sstRecord.getString(lsrec.getSSTIndex()).toString();
        break;
    case NoteRecord.sid:
        NoteRecord nrec = (NoteRecord) record;
        thisRow = nrec.getRow();
        // TODO: Find object to match nrec.getShapeId()
        break;
    case NumberRecord.sid:
        NumberRecord numrec = (NumberRecord) record;
        thisRow = numrec.getRow();
        thisText = _ft.formatNumberDateCell(numrec);
        break;
    default:
        break;
    }

    if(thisText != null) {
        if(thisRow != rowNum) {
            rowNum = thisRow;
            if(_text.length() > 0)
                _text.append("\n");
        } else {
            _text.append("\t");
        }
        _text.append(thisText);
    }
}
 
Example 19
Source File: RowBlocksReader.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Also collects any loose MergeCellRecords and puts them in the supplied
 * mergedCellsTable
 * 
 * @param  rs the record stream
 */
public RowBlocksReader(RecordStream rs) {
	List<Record> plainRecords = new ArrayList<Record>();
	List<Record> shFrmRecords = new ArrayList<Record>();
	List<CellReference> firstCellRefs = new ArrayList<CellReference>();
	List<Record> arrayRecords = new ArrayList<Record>();
	List<Record> tableRecords = new ArrayList<Record>();
	List<Record> mergeCellRecords = new ArrayList<Record>();

	Record prevRec = null;
	while(!RecordOrderer.isEndOfRowBlock(rs.peekNextSid())) {
		// End of row/cell records for the current sheet
		// Note - It is important that this code does not inadvertently add any sheet
		// records from a subsequent sheet.  For example, if SharedFormulaRecords
		// are taken from the wrong sheet, this could cause bug 44449.
		if (!rs.hasNext()) {
			throw new RuntimeException("Failed to find end of row/cell records");

		}
		Record rec = rs.getNext();
		List<Record> dest;
		switch (rec.getSid()) {
			case MergeCellsRecord.sid:    dest = mergeCellRecords; break;
			case SharedFormulaRecord.sid: dest = shFrmRecords;
				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:         dest = arrayRecords;     break;
			case TableRecord.sid:         dest = tableRecords;     break;
			default:                      dest = plainRecords;
		}
		dest.add(rec);
		prevRec = rec;
	}
	SharedFormulaRecord[] sharedFormulaRecs = new SharedFormulaRecord[shFrmRecords.size()];
	CellReference[] firstCells = new CellReference[firstCellRefs.size()];
	ArrayRecord[] arrayRecs = new ArrayRecord[arrayRecords.size()];
	TableRecord[] tableRecs = new TableRecord[tableRecords.size()];
	shFrmRecords.toArray(sharedFormulaRecs);
	firstCellRefs.toArray(firstCells);
	arrayRecords.toArray(arrayRecs);
	tableRecords.toArray(tableRecs);

	_plainRecords = plainRecords;
	_sfm = SharedValueManager.create(sharedFormulaRecs, firstCells, arrayRecs, tableRecs);
	_mergedCellsRecords = new MergeCellsRecord[mergeCellRecords.size()];
	mergeCellRecords.toArray(_mergedCellsRecords);
}
 
Example 20
Source File: NumberRecordHandler.java    From easyexcel with Apache License 2.0 4 votes vote down vote up
@Override
public boolean couldDecode(Record record) {
	return NumberRecord.sid == record.getSid();
}