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 dc45d4ce75
commit de0dcda820
4 changed files with 16 additions and 17 deletions

View File

@ -122,9 +122,8 @@ public final class QuickButCruddyTextExtractor {
*/
public String getTextAsString() {
StringBuffer ret = new StringBuffer();
Vector textV = getTextAsVector();
for(int i=0; i<textV.size(); i++) {
String text = (String)textV.get(i);
Vector<String> textV = getTextAsVector();
for(String text : textV) {
ret.append(text);
if(! text.endsWith("\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
* strings, one per text record
*/
public Vector getTextAsVector() {
Vector textV = new Vector();
public Vector<String> getTextAsVector() {
Vector<String> textV = new Vector<String>();
// Set to the start of the file
int walkPos = 0;
@ -159,7 +158,7 @@ public final class QuickButCruddyTextExtractor {
* If it is a text record, grabs out the text. Whatever happens, returns
* 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
// Note that the length doesn't include the 8 byte atom header
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
* 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
* held inside _ptrData. Used when writing out, and updating
* the positions of the slides
*/
private Hashtable _slideOffsetDataLocation;
private Hashtable<Integer,Integer> _slideOffsetDataLocation;
/**
* Get the list of slides that this PersistPtrHolder knows about.
@ -63,9 +63,9 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
*/
public int[] getKnownSlideIDs() {
int[] ids = new int[_slideLocations.size()];
Enumeration e = _slideLocations.keys();
Enumeration<Integer> e = _slideLocations.keys();
for(int i=0; i<ids.length; i++) {
Integer id = (Integer)e.nextElement();
Integer id = e.nextElement();
ids[i] = id.intValue();
}
return ids;
@ -75,14 +75,14 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
* Get the lookup from slide numbers to byte offsets, for the slides
* known about by this PersistPtrHolder.
*/
public Hashtable getSlideLocationsLookup() {
public Hashtable<Integer,Integer> getSlideLocationsLookup() {
return _slideLocations;
}
/**
* Get the lookup from slide numbers to their offsets inside
* _ptrData, used when adding or moving slides.
*/
public Hashtable getSlideOffsetDataLocationsLookup() {
public Hashtable<Integer,Integer> getSlideOffsetDataLocationsLookup() {
return _slideOffsetDataLocation;
}
@ -140,8 +140,8 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
// base number for these entries
// count * 32 bit offsets
// Repeat as many times as you have data
_slideLocations = new Hashtable();
_slideOffsetDataLocation = new Hashtable();
_slideLocations = new Hashtable<Integer,Integer>();
_slideOffsetDataLocation = new Hashtable<Integer,Integer>();
_ptrData = new byte[len-8];
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
* new positions
*/
public void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup) {
public void updateOtherRecordReferences(Hashtable<Integer,Integer> oldToNewReferencesLookup) {
int[] slideIDs = getKnownSlideIDs();
// 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
* 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
* locations
*/
public abstract void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup);
public abstract void updateOtherRecordReferences(Hashtable<Integer,Integer> oldToNewReferencesLookup);
}