Methods Summary |
---|
public java.lang.Object | clone()
ProtectRecord rec = new ProtectRecord();
rec.field_1_protect = field_1_protect;
return rec;
|
protected void | fillFields(org.apache.poi.hssf.record.RecordInputStream in)
field_1_protect = in.readShort();
|
public boolean | getProtect()get whether the sheet is protected or not
return (field_1_protect == 1);
|
public int | getRecordSize()
return 6;
|
public short | getSid()
return sid;
|
public int | serialize(int offset, byte[] data)
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset,
(( short ) 0x02)); // 2 bytes (6 total)
LittleEndian.putShort(data, 4 + offset, field_1_protect);
return getRecordSize();
|
public void | setProtect(boolean protect)set whether the sheet is protected or not
if (protect)
{
field_1_protect = 1;
}
else
{
field_1_protect = 0;
}
|
public java.lang.String | toString()
StringBuffer buffer = new StringBuffer();
buffer.append("[PROTECT]\n");
buffer.append(" .protect = ").append(getProtect())
.append("\n");
buffer.append("[/PROTECT]\n");
return buffer.toString();
|
protected void | validateSid(short id)
if (id != sid)
{
throw new RecordFormatException("NOT A PROTECT RECORD");
}
|