EscherComplexPropertypublic class EscherComplexProperty extends EscherProperty A complex property differs from a simple property in that the data can not fit inside a 32 bit
integer. See the specification for more detailed information regarding exactly what is
stored here. |
Fields Summary |
---|
byte[] | complexData |
Constructors Summary |
---|
public EscherComplexProperty(short id, byte[] complexData)Create a complex property using the property id and a byte array containing the complex
data value.
super( id );
this.complexData = complexData;
| public EscherComplexProperty(short propertyNumber, boolean isBlipId, byte[] complexData)Create a complex property using the property number, a flag to indicate whether this is a
blip reference and the complex property data.
super( propertyNumber, true, isBlipId );
this.complexData = complexData;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object o)Determine whether this property is equal to another property.
if ( this == o ) return true;
if ( !( o instanceof EscherComplexProperty ) ) return false;
final EscherComplexProperty escherComplexProperty = (EscherComplexProperty) o;
if ( !Arrays.equals( complexData, escherComplexProperty.complexData ) ) return false;
return true;
| public byte[] | getComplexData()Get the complex data value.
return complexData;
| public int | getPropertySize()Caclulates the number of bytes required to serialize this property.
return 6 + complexData.length;
| public int | hashCode()Calculates a hashcode for this property.
return getId() * 11;
| public int | serializeComplexPart(byte[] data, int pos)Serializes the complex part of this property
System.arraycopy(complexData, 0, data, pos, complexData.length);
return complexData.length;
| public int | serializeSimplePart(byte[] data, int pos)Serializes the simple part of this property. ie the first 6 bytes.
LittleEndian.putShort(data, pos, getId());
LittleEndian.putInt(data, pos + 2, complexData.length);
return 6;
| public java.lang.String | toString()Retrieves the string representation for this property.
String dataStr;
ByteArrayOutputStream b = new ByteArrayOutputStream();
try
{
HexDump.dump( this.complexData, 0, b, 0 );
dataStr = b.toString();
}
catch ( Exception e )
{
dataStr = e.toString();
}
finally
{
try
{
b.close();
}
catch ( IOException e )
{
e.printStackTrace();
}
}
return "propNum: " + getPropertyNumber()
+ ", propName: " + EscherProperties.getPropertyName( getPropertyNumber() )
+ ", complex: " + isComplex()
+ ", blipId: " + isBlipId()
+ ", data: " + System.getProperty("line.separator") + dataStr;
|
|