}
}
- private List escherRecords;
+ private List<EscherRecord> escherRecords;
private byte[] rawData;
public AbstractEscherHolderRecord()
{
- escherRecords = new ArrayList();
+ escherRecords = new ArrayList<EscherRecord>();
}
public AbstractEscherHolderRecord(RecordInputStream in)
{
- escherRecords = new ArrayList();
+ escherRecords = new ArrayList<EscherRecord>();
if (! DESERIALISE )
{
rawData = in.readRemainder();
buffer.append('[' + getRecordName() + ']' + nl);
if (escherRecords.size() == 0)
buffer.append("No Escher Records Decoded" + nl);
- for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
+ for ( Iterator<EscherRecord> iterator = escherRecords.iterator(); iterator.hasNext(); )
{
- EscherRecord r = (EscherRecord) iterator.next();
+ EscherRecord r = iterator.next();
buffer.append(r.toString());
}
buffer.append("[/" + getRecordName() + ']' + nl);
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
int pos = offset + 4;
- for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
+ for ( Iterator<EscherRecord> iterator = escherRecords.iterator(); iterator.hasNext(); )
{
- EscherRecord r = (EscherRecord) iterator.next();
+ EscherRecord r = iterator.next();
pos += r.serialize( pos, data, new NullEscherSerializationListener() );
}
return getRecordSize();
return rawData.length;
}
int size = 0;
- for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
+ for ( Iterator<EscherRecord> iterator = escherRecords.iterator(); iterator.hasNext(); )
{
- EscherRecord r = (EscherRecord) iterator.next();
+ EscherRecord r = iterator.next();
size += r.getRecordSize();
}
return size;
return escherRecords.add( element );
}
- public List getEscherRecords()
+ public List<EscherRecord> getEscherRecords()
{
return escherRecords;
}
* then return that.
*/
public EscherContainerRecord getEscherContainer() {
- for(Iterator it = escherRecords.iterator(); it.hasNext();) {
- Object er = it.next();
+ for(Iterator<EscherRecord> it = escherRecords.iterator(); it.hasNext();) {
+ EscherRecord er = it.next();
if(er instanceof EscherContainerRecord) {
return (EscherContainerRecord)er;
}
import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.CreationHelper;
+import org.apache.poi.ss.usermodel.PictureData;
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy;
import org.apache.poi.ss.formula.FormulaType;
import org.apache.poi.util.POILogFactory;
*
* @return the list of pictures (a list of {@link HSSFPictureData} objects.)
*/
- public List<HSSFPictureData> getAllPictures()
+ public List<PictureData> getAllPictures()
{
// The drawing group record always exists at the top level, so we won't need to do this recursively.
- List<HSSFPictureData> pictures = new ArrayList<HSSFPictureData>();
- Iterator recordIter = workbook.getRecords().iterator();
+ List<PictureData> pictures = new ArrayList<PictureData>();
+ Iterator<Record> recordIter = workbook.getRecords().iterator();
while (recordIter.hasNext())
{
- Object obj = recordIter.next();
- if (obj instanceof AbstractEscherHolderRecord)
+ Record r = recordIter.next();
+ if (r instanceof AbstractEscherHolderRecord)
{
- ((AbstractEscherHolderRecord) obj).decode();
- List escherRecords = ((AbstractEscherHolderRecord) obj).getEscherRecords();
+ ((AbstractEscherHolderRecord) r).decode();
+ List<EscherRecord> escherRecords = ((AbstractEscherHolderRecord) r).getEscherRecords();
searchForPictures(escherRecords, pictures);
}
}
* @param escherRecords the escher records.
* @param pictures the list to populate with the pictures.
*/
- private void searchForPictures(List escherRecords, List<HSSFPictureData> pictures)
+ private void searchForPictures(List escherRecords, List<PictureData> pictures)
{
Iterator recordIter = escherRecords.iterator();
while (recordIter.hasNext())