Package org.apache.poi.ddf
Class EscherArrayProperty
- java.lang.Object
-
- org.apache.poi.ddf.EscherProperty
-
- org.apache.poi.ddf.EscherComplexProperty
-
- org.apache.poi.ddf.EscherArrayProperty
-
- All Implemented Interfaces:
java.lang.Iterable<byte[]>
public final class EscherArrayProperty extends EscherComplexProperty implements java.lang.Iterable<byte[]>
Escher array properties are the most weird construction ever invented with all sorts of special cases. I'm hopeful I've got them all.
-
-
Constructor Summary
Constructors Constructor Description EscherArrayProperty(short propertyNumber, boolean isBlipId, byte[] complexData)EscherArrayProperty(short id, byte[] complexData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getElement(int index)intgetNumberOfElementsInArray()intgetNumberOfElementsInMemory()shortgetSizeOfElements()java.util.Iterator<byte[]>iterator()intserializeSimplePart(byte[] data, int pos)Serializes the simple part of this property.intsetArrayData(byte[] data, int offset)We have this method because the way in which arrays in escher works is screwed for seemly arbitrary reasons.voidsetElement(int index, byte[] element)voidsetNumberOfElementsInArray(int numberOfElements)voidsetNumberOfElementsInMemory(int numberOfElements)voidsetSizeOfElements(int sizeOfElements)java.lang.StringtoString()Retrieves the string representation for this property.java.lang.StringtoXml(java.lang.String tab)-
Methods inherited from class org.apache.poi.ddf.EscherComplexProperty
equals, getComplexData, getPropertySize, hashCode, serializeComplexPart
-
Methods inherited from class org.apache.poi.ddf.EscherProperty
getId, getName, getPropertyNumber, isBlipId, isComplex
-
-
-
-
Method Detail
-
getNumberOfElementsInArray
public int getNumberOfElementsInArray()
-
setNumberOfElementsInArray
public void setNumberOfElementsInArray(int numberOfElements)
-
getNumberOfElementsInMemory
public int getNumberOfElementsInMemory()
-
setNumberOfElementsInMemory
public void setNumberOfElementsInMemory(int numberOfElements)
-
getSizeOfElements
public short getSizeOfElements()
-
setSizeOfElements
public void setSizeOfElements(int sizeOfElements)
-
getElement
public byte[] getElement(int index)
-
setElement
public void setElement(int index, byte[] element)
-
toString
public java.lang.String toString()
Description copied from class:EscherComplexPropertyRetrieves the string representation for this property.- Overrides:
toStringin classEscherComplexProperty
-
toXml
public java.lang.String toXml(java.lang.String tab)
- Overrides:
toXmlin classEscherComplexProperty
-
setArrayData
public int setArrayData(byte[] data, int offset)We have this method because the way in which arrays in escher works is screwed for seemly arbitrary reasons. While most properties are fairly consistent and have a predictable array size, escher arrays have special cases.- Parameters:
data- The data array containing the escher array informationoffset- The offset into the array to start reading from.- Returns:
- the number of bytes used by this complex property.
-
serializeSimplePart
public int serializeSimplePart(byte[] data, int pos)Serializes the simple part of this property. ie the first 6 bytes. Needs special code to handle the case when the size doesn't include the size of the header block- Overrides:
serializeSimplePartin classEscherComplexProperty- Parameters:
data- the buffer to write topos- the starting position- Returns:
- the length of the part
-
iterator
public java.util.Iterator<byte[]> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<byte[]>
-
-