1 16 17 package org.apache.poi.hwpf.usermodel; 18 19 import org.apache.poi.util.LittleEndian; 20 21 26 public class LineSpacingDescriptor 27 implements Cloneable 28 { 29 short _dyaLine; 30 short _fMultiLinespace; 31 32 public LineSpacingDescriptor() 33 { 34 } 35 36 public LineSpacingDescriptor(byte[] buf, int offset) 37 { 38 _dyaLine = LittleEndian.getShort(buf, offset); 39 _fMultiLinespace = LittleEndian.getShort(buf, offset + LittleEndian.SHORT_SIZE); 40 } 41 42 public Object clone() 43 throws CloneNotSupportedException 44 { 45 return super.clone(); 46 } 47 48 public void setMultiLinespace(short fMultiLinespace) 49 { 50 _fMultiLinespace = fMultiLinespace; 51 } 52 53 public int toInt() 54 { 55 byte[] intHolder = new byte[4]; 56 serialize(intHolder, 0); 57 return LittleEndian.getInt(intHolder); 58 } 59 60 public void serialize(byte[] buf, int offset) 61 { 62 LittleEndian.putShort(buf, offset, _dyaLine); 63 LittleEndian.putShort(buf, offset + LittleEndian.SHORT_SIZE, _fMultiLinespace); 64 } 65 66 public void setDyaLine(short dyaLine) 67 { 68 _dyaLine = dyaLine; 69 } 70 public boolean equals(Object o) 71 { 72 LineSpacingDescriptor lspd = (LineSpacingDescriptor)o; 73 74 return _dyaLine == lspd._dyaLine && _fMultiLinespace == lspd._fMultiLinespace; 75 } 76 } 77 | Popular Tags |