Fix some HSLF generics warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1024368 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2010-10-19 19:22:24 +00:00
parent 40c968c111
commit a954289390
4 changed files with 16 additions and 17 deletions

View File

@ -122,9 +122,8 @@ public final class QuickButCruddyTextExtractor {
*/ */
public String getTextAsString() { public String getTextAsString() {
StringBuffer ret = new StringBuffer(); StringBuffer ret = new StringBuffer();
Vector textV = getTextAsVector(); Vector<String> textV = getTextAsVector();
for(int i=0; i<textV.size(); i++) { for(String text : textV) {
String text = (String)textV.get(i);
ret.append(text); ret.append(text);
if(! text.endsWith("\n")) { if(! text.endsWith("\n")) {
ret.append('\n'); ret.append('\n');
@ -137,8 +136,8 @@ public final class QuickButCruddyTextExtractor {
* Fetches the ALL the text of the powerpoint file, in a vector of * Fetches the ALL the text of the powerpoint file, in a vector of
* strings, one per text record * strings, one per text record
*/ */
public Vector getTextAsVector() { public Vector<String> getTextAsVector() {
Vector textV = new Vector(); Vector<String> textV = new Vector<String>();
// Set to the start of the file // Set to the start of the file
int walkPos = 0; int walkPos = 0;
@ -159,7 +158,7 @@ public final class QuickButCruddyTextExtractor {
* If it is a text record, grabs out the text. Whatever happens, returns * If it is a text record, grabs out the text. Whatever happens, returns
* the position of the next record, or -1 if no more. * the position of the next record, or -1 if no more.
*/ */
public int findTextRecords(int startPos, Vector textV) { public int findTextRecords(int startPos, Vector<String> textV) {
// Grab the length, and the first option byte // Grab the length, and the first option byte
// Note that the length doesn't include the 8 byte atom header // Note that the length doesn't include the 8 byte atom header
int len = (int)LittleEndian.getUInt(pptContents,startPos+4); int len = (int)LittleEndian.getUInt(pptContents,startPos+4);

View File

@ -48,13 +48,13 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
* You always need to check the most recent PersistPtrHolder * You always need to check the most recent PersistPtrHolder
* that knows about a given slide to find the right location * that knows about a given slide to find the right location
*/ */
private Hashtable _slideLocations; private Hashtable<Integer,Integer> _slideLocations;
/** /**
* Holds the lookup from slide id to where their offset is * Holds the lookup from slide id to where their offset is
* held inside _ptrData. Used when writing out, and updating * held inside _ptrData. Used when writing out, and updating
* the positions of the slides * the positions of the slides
*/ */
private Hashtable _slideOffsetDataLocation; private Hashtable<Integer,Integer> _slideOffsetDataLocation;
/** /**
* Get the list of slides that this PersistPtrHolder knows about. * Get the list of slides that this PersistPtrHolder knows about.
@ -63,9 +63,9 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
*/ */
public int[] getKnownSlideIDs() { public int[] getKnownSlideIDs() {
int[] ids = new int[_slideLocations.size()]; int[] ids = new int[_slideLocations.size()];
Enumeration e = _slideLocations.keys(); Enumeration<Integer> e = _slideLocations.keys();
for(int i=0; i<ids.length; i++) { for(int i=0; i<ids.length; i++) {
Integer id = (Integer)e.nextElement(); Integer id = e.nextElement();
ids[i] = id.intValue(); ids[i] = id.intValue();
} }
return ids; return ids;
@ -75,14 +75,14 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
* Get the lookup from slide numbers to byte offsets, for the slides * Get the lookup from slide numbers to byte offsets, for the slides
* known about by this PersistPtrHolder. * known about by this PersistPtrHolder.
*/ */
public Hashtable getSlideLocationsLookup() { public Hashtable<Integer,Integer> getSlideLocationsLookup() {
return _slideLocations; return _slideLocations;
} }
/** /**
* Get the lookup from slide numbers to their offsets inside * Get the lookup from slide numbers to their offsets inside
* _ptrData, used when adding or moving slides. * _ptrData, used when adding or moving slides.
*/ */
public Hashtable getSlideOffsetDataLocationsLookup() { public Hashtable<Integer,Integer> getSlideOffsetDataLocationsLookup() {
return _slideOffsetDataLocation; return _slideOffsetDataLocation;
} }
@ -140,8 +140,8 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
// base number for these entries // base number for these entries
// count * 32 bit offsets // count * 32 bit offsets
// Repeat as many times as you have data // Repeat as many times as you have data
_slideLocations = new Hashtable(); _slideLocations = new Hashtable<Integer,Integer>();
_slideOffsetDataLocation = new Hashtable(); _slideOffsetDataLocation = new Hashtable<Integer,Integer>();
_ptrData = new byte[len-8]; _ptrData = new byte[len-8];
System.arraycopy(source,start+8,_ptrData,0,_ptrData.length); System.arraycopy(source,start+8,_ptrData,0,_ptrData.length);
@ -181,7 +181,7 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
* At write-out time, update the references to the sheets to their * At write-out time, update the references to the sheets to their
* new positions * new positions
*/ */
public void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup) { public void updateOtherRecordReferences(Hashtable<Integer,Integer> oldToNewReferencesLookup) {
int[] slideIDs = getKnownSlideIDs(); int[] slideIDs = getKnownSlideIDs();
// Loop over all the slides we know about // Loop over all the slides we know about

View File

@ -47,5 +47,5 @@ public interface PositionDependentRecord
* Offer the record the list of records that have changed their * Offer the record the list of records that have changed their
* location as part of the writeout. * location as part of the writeout.
*/ */
public void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup); public void updateOtherRecordReferences(Hashtable<Integer,Integer> oldToNewReferencesLookup);
} }

View File

@ -48,5 +48,5 @@ public abstract class PositionDependentRecordAtom extends RecordAtom implements
* Allows records to update their internal pointers to other records * Allows records to update their internal pointers to other records
* locations * locations
*/ */
public abstract void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup); public abstract void updateOtherRecordReferences(Hashtable<Integer,Integer> oldToNewReferencesLookup);
} }