FileDocCategorySizeDatePackage
ListFormatOverrideLevel.javaAPI DocApache Poi 3.0.13218Mon Jan 01 18:55:32 GMT 2007org.apache.poi.hwpf.model

ListFormatOverrideLevel

public class ListFormatOverrideLevel extends Object

Fields Summary
private static final int
BASE_SIZE
int
_iStartAt
byte
_info
private static BitField
_ilvl
private static BitField
_fStartAt
private static BitField
_fFormatting
byte[]
_reserved
ListLevel
_lvl
Constructors Summary
public ListFormatOverrideLevel(byte[] buf, int offset)


      
  
    _iStartAt = LittleEndian.getInt(buf, offset);
    offset += LittleEndian.INT_SIZE;
    _info = buf[offset++];
    System.arraycopy(buf, offset, _reserved, 0, _reserved.length);
    offset += _reserved.length;

    if (_fFormatting.getValue(_info) > 0)
    {
      _lvl = new ListLevel(buf, offset);
    }
  
Methods Summary
public booleanequals(java.lang.Object obj)

    if (obj == null)
    {
      return false;
    }
    ListFormatOverrideLevel lfolvl = (ListFormatOverrideLevel)obj;
    boolean lvlEquality = false;
    if (_lvl != null)
    {
      lvlEquality = _lvl.equals(lfolvl._lvl);
    }
    else
    {
      lvlEquality = lfolvl._lvl == null;
    }

    return lvlEquality && lfolvl._iStartAt == _iStartAt && lfolvl._info == _info &&
      Arrays.equals(lfolvl._reserved, _reserved);
  
public org.apache.poi.hwpf.model.ListLevelgetLevel()

    return _lvl;
  
public intgetLevelNum()

    return _ilvl.getValue(_info);
  
public intgetSizeInBytes()

    return (_lvl == null ? BASE_SIZE : BASE_SIZE + _lvl.getSizeInBytes());
  
public booleanisFormatting()

    return _fFormatting.getValue(_info) != 0;
  
public booleanisStartAt()

    return _fStartAt.getValue(_info) != 0;
  
public byte[]toByteArray()

    byte[] buf = new byte[getSizeInBytes()];

    int offset = 0;
    LittleEndian.putInt(buf, _iStartAt);
    offset += LittleEndian.INT_SIZE;
    buf[offset++] = _info;
    System.arraycopy(_reserved, 0, buf, offset, 3);
    offset += 3;

    if (_lvl != null)
    {
      byte[] levelBuf = _lvl.toByteArray();
      System.arraycopy(levelBuf, 0, buf, offset, levelBuf.length);
    }

    return buf;