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

PropertyNode

public abstract class PropertyNode extends Object implements Comparable, Cloneable
Represents a lightweight node in the Trees used to store content properties.
author
Ryan Ackley

Fields Summary
protected Object
_buf
private int
_cpStart
private int
_cpEnd
Constructors Summary
protected PropertyNode(int fcStart, int fcEnd, Object buf)

param
fcStart The start of the text for this property.
param
fcEnd The end of the text for this property.
param
buf FIXME: Old documentation is: "grpprl The property description in compressed form."

      _cpStart = fcStart;
      _cpEnd = fcEnd;
      _buf = buf;

  
Methods Summary
public voidadjustForDelete(int start, int length)
Adjust for a deletion that can span multiple PropertyNodes.

param
start
param
length

    int end = start + length;

    if (_cpEnd > start)
    {
      if (_cpStart < end)
      {
        _cpEnd = end >= _cpEnd ? start : _cpEnd - length;
        _cpStart = Math.min(start, _cpStart);
      }
      else
      {
        _cpEnd -= length;
        _cpStart -= length;
      }
    }
  
public java.lang.Objectclone()

    return super.clone();
  
public intcompareTo(java.lang.Object o)
Used for sorting in collections.

      int cpEnd = ((PropertyNode)o).getEnd();
      if(_cpEnd == cpEnd)
      {
        return 0;
      }
      else if(_cpEnd < cpEnd)
      {
        return -1;
      }
      else
      {
        return 1;
      }
  
public booleanequals(java.lang.Object o)

    if (limitsAreEqual(o))
    {
      Object testBuf = ((PropertyNode)o)._buf;
      if (testBuf instanceof byte[] && _buf instanceof byte[])
      {
        return Arrays.equals((byte[])testBuf, (byte[])_buf);
      }
      return _buf.equals(testBuf);
    }
    return false;
  
public intgetEnd()

return
The offset of the end of this property's text.

    return _cpEnd;
  
public intgetStart()

return
The offset of this property's text.

      return _cpStart;
  
protected booleanlimitsAreEqual(java.lang.Object o)

    return ((PropertyNode)o).getStart() == _cpStart &&
           ((PropertyNode)o).getEnd() == _cpEnd;

  
public voidsetEnd(int end)

    _cpEnd = end;
  
public voidsetStart(int start)

    _cpStart = start;