FileDocCategorySizeDatePackage
ErrPtg.javaAPI DocApache Poi 3.0.12781Mon Jan 01 12:39:40 GMT 2007org.apache.poi.hssf.record.formula

ErrPtg

public class ErrPtg extends Ptg
author
Daniel Noll (daniel at nuix dot com dot au)

Fields Summary
public static final short
sid
private static final int
SIZE
private byte
field_1_error_code
Constructors Summary
public ErrPtg()
Creates new ErrPtg


        

     
    
    
public ErrPtg(RecordInputStream in)

        field_1_error_code = in.readByte();
    
Methods Summary
public java.lang.Objectclone()

        ErrPtg ptg = new ErrPtg();
        ptg.field_1_error_code = field_1_error_code;
        return ptg;
    
public bytegetDefaultOperandClass()

        return Ptg.CLASS_VALUE;
    
public intgetSize()

        return SIZE;
    
public java.lang.StringtoFormulaString(org.apache.poi.hssf.model.Workbook book)

        switch(field_1_error_code)
        {
            case HSSFErrorConstants.ERROR_NULL:
                return "#NULL!";
            case HSSFErrorConstants.ERROR_DIV_0:
                return "#DIV/0!";
            case HSSFErrorConstants.ERROR_VALUE:
                return "#VALUE!";
            case HSSFErrorConstants.ERROR_REF:
                return "#REF!";
            case HSSFErrorConstants.ERROR_NAME:
                return "#NAME?";
            case HSSFErrorConstants.ERROR_NUM:
                return "#NUM!";
            case HSSFErrorConstants.ERROR_NA:
                return "#N/A";
        }

        // Shouldn't happen anyway.  Excel docs say that this is returned for all other codes.
        return "#N/A";
    
public voidwriteBytes(byte[] array, int offset)

        array[offset] = (byte) (sid + ptgClass);
        array[offset + 1] = field_1_error_code;